jhamlet / svg-react-loader

Webpack SVG to React Component Loader
MIT License
559 stars 82 forks source link

Create unique ID prefix within SVGs to prevent ID collisions #108

Open SilverFox70 opened 6 years ago

SilverFox70 commented 6 years ago

Haven't had time to go back over this with a fine tooth comb since I made these changes, but it is working fine on two separate production sites at this point. It could be made more robust by implementing a 'usable' default prefix based on something like shortid, but that would meaning adding dependencies: see lib/sanitize/filters/unique-svg-ids.js at line line 7 for more info.

jhamlet commented 5 years ago

As far as I can see this is looking good.

I made a couple more comments about defaulting to having this feature on, instead of off.

I'll merge it some time over the weekend.

Thanks,

;-j

jedrichards commented 5 years ago

Is there anything I can do to help get this feature merged?

SilverFox70 commented 5 years ago

I just added the last change - to make uniqueIdPrefix default to true.