embiem / react-canvas-draw

React Component for drawing in canvas
https://embiem.github.io/react-canvas-draw/
MIT License
902 stars 315 forks source link

Fix image not shown due to cache #59

Closed henrych4 closed 4 years ago

henrych4 commented 4 years ago

Fix #57

embiem commented 4 years ago

Thanks for the PR!

Did this fix your issue consistently?

Is it because when loaded from cache, the onload callback wouldn't fire? I wasn't aware that setting the image src would trigger a synchronous load when the image comes from the cache.

henrych4 commented 4 years ago

Yes this should fix the issue.

Reference: https://stackoverflow.com/questions/12354865/image-onload-event-and-browser-cache