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:
fpdk
2021-02-27 14:56:09 +01:00
parent 35e4442b03
commit 1c42b39e15

View File

@@ -18,10 +18,11 @@ export default (iconsObject, options) => {
const svgString = iconsObject[icon];
const dom = parseDOM(svgString);
const children = dom.map(element => {
const children = dom.map((element, index) => {
if (options.renderUniqueKey) {
const hashSource = {
name: element.name,
index,
...element.attribs,
};