Epimetheus icon indicating copy to clipboard operation
Epimetheus copied to clipboard

Unique IDs for SVGs

Open tiiavalt opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. Currently our clipPaths have same ID for same SVGs, so same ID can appear on multiple elements in DOM even though IDs should be unique.

Describe the solution you'd like Create a solution that allows clipPaths ID to change, so there wouldn't be duplicate IDs.


The result

  • Created a new component for SVGs called SvgIcon.jsx
  • The component is used by giving it a parameter called svg with the argument of wanted SVG's name
  • Unique IDs are generated automatically, but one can also be given as parameter

tiiavalt avatar Apr 22 '21 10:04 tiiavalt