rrutsche / react-parallax

A React Component for parallax effect
MIT License
855 stars 76 forks source link

Image onLoad listener added, but not removed while component unmounts #40

Closed zespolkropkanadi closed 6 years ago

zespolkropkanadi commented 6 years ago

Hi,

Please take a look here. This line of code adds onload event listener to image, which is setting Parallax component state. But when component unmounts (f.e. when changing route) listener is not detached, which causes error:

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 t component.

rrutsche commented 6 years ago

Thanks for the report. I will have a look.

rrutsche commented 6 years ago

The 1.6.1 release should fix the issue