react-fullpage icon indicating copy to clipboard operation
react-fullpage copied to clipboard

handleResize: Can only update a mounted or mounting component.

Open Krempelj opened this issue 7 years ago • 1 comments

Hi. So navigating away from a component that uses this cool package and then resizing the displaying component causes this error. Is there a way to avoid this?

handleresize

Krempelj avatar Dec 16 '17 17:12 Krempelj

FWIW, I figured out what the issue here is. You have to .bind() your resize function before you assign it in window.addEventListener. Because this wasn't done, when the Section component tries to unmount, it doesn't correctly remove the resize listener (different function). The fix is trivial, but it looks like the author of this package is no longer resolving Pull Requests.

I will probably end up making a fork for my own projects

Garoth avatar Apr 24 '18 03:04 Garoth