mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-17 15:37:42 +01:00
renderUniqueKey will generate duplicate keys if the SVG attributse are identical.
Fixed by adding an index attribute to the hash.
This commit is contained in:
@@ -18,10 +18,11 @@ export default (iconsObject, options) => {
|
|||||||
const svgString = iconsObject[icon];
|
const svgString = iconsObject[icon];
|
||||||
const dom = parseDOM(svgString);
|
const dom = parseDOM(svgString);
|
||||||
|
|
||||||
const children = dom.map(element => {
|
const children = dom.map((element, index) => {
|
||||||
if (options.renderUniqueKey) {
|
if (options.renderUniqueKey) {
|
||||||
const hashSource = {
|
const hashSource = {
|
||||||
name: element.name,
|
name: element.name,
|
||||||
|
index,
|
||||||
...element.attribs,
|
...element.attribs,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user