javierbyte / react-blur

React component to blur image backgrounds using canvas.
https://javier.xyz/react-blur/
BSD 3-Clause "New" or "Revised" License
460 stars 48 forks source link

Guard against unmounting before image loads #23

Closed torjusb closed 3 years ago

torjusb commented 6 years ago

If the component unmounts before the image is loaded, the refs will be null. This is because React calls the ref callbacks with null as the component unmount.

We use this component in a virtualized list using React Virtualize. You can scroll through the list really fast, meaning that we sometimes mount and unmount components in an instant.

javierbyte commented 3 years ago

Should be fixed in the latest update, sorry for the delay of many years.