Skip to content

Commit

Permalink
renderUniqueKey will generate duplicate keys if the SVG attributse ar…
Browse files Browse the repository at this point in the history
…e identical.

Fixed by adding an index attribute to the hash.
  • Loading branch information
FPDK committed Feb 27, 2021
1 parent 35e4442 commit 1c42b39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/render/renderIconNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit 1c42b39

Please sign in to comment.