sambernard / react-preload

Component to preload images before showing content
MIT License
148 stars 48 forks source link

Warning on route change #10

Closed kennypascal closed 8 years ago

kennypascal commented 8 years ago

It appears switching to a new route while images are still preloading will cause an error. This may occur because there is no componentWillUnmount to clear the event listeners?

warning.js?0260:45 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the undefined component.warning @ warning.js?0260:45getInternalInstanceReadyForUpdate @ ReactUpdateQueue.js?fd2c:34ReactUpdateQueue.enqueueSetState @ ReactUpdateQueue.js?fd2c:181ReactComponent.setState @ ReactComponent.js?702a:65_handleSuccess @ Preload.js?631e:113

sambernard commented 8 years ago

Fixed in 0924f298bfd0ea3522f79c9138aa9b70717b31a6