gilbarbara / react-inlinesvg

An SVG loader component for ReactJS

Home Page:https://codesandbox.io/s/github/gilbarbara/react-inlinesvg/tree/main/demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrapper prevents failed image loading from propagating

gom59 opened this issue · comments

commented

I might be doing something really stupid, but I created a wrapper around this module, and am facing issues when the image loading fails. A very simplified version of this wrapper is here:
https://codesandbox.io/s/svgimage-egrpm?file=/src/App.js

If two (or more) wrapped versions of react-inlinesvg fail to load the same file, only the first one will get to the failed state. The other ones keep on displaying the loader.
I thought this might be due to the uniqueHash/uniquifyIDs parameters, so I added those to differentiate the instances, but this does nothing (the purpose of this parameter is not really clear?).

As a side note, in the readme file, the link to 'https://taye.me/blog/svg/a-guide-to-svg-use-elements/' seems to be broken, the last '/' character should be removed...

Hey @gom59
It is a bug with the cache system, I'll take a look when I have some time.

About the README, I removed those extra links that weren't related to CORS

commented

Thank you.

@gom59
Fixed in 2.1.0!

commented

Really great, thanks!!!