b-zurg / react-collapse-pane

The splittable, draggable, collapsible panel layout library 🎉
https://storybook-collapse-pane.netlify.app/
MIT License
210 stars 35 forks source link

fix: Memory leak in quick component unmounts #15

Closed b-zurg closed 4 years ago

b-zurg commented 4 years ago

This happens only when unmounting the component quickly after mounting it.

react_devtools_backend.js:6 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
    in Component (created by Component)
    in div (created by styled.div)
    in styled.div
    in div (created by styled.div)
    in styled.div
    in Unknown (created by SplitPane)
    in div (created by styled.div)
    in styled.div (created by SplitPane)
    in SplitPane (created by Component)
    in div (created by styled.div)
    in styled.div (created by Component)
    in Component (created by Component)
    in Component (created by Component)

I believe this has to do with the dragStateHandlers hook and the window-level event listeners that are firing off a set state after it's been unmounted. I will have to look into ensuring they are cleaned up.

github-actions[bot] commented 4 years ago

:tada: This issue has been resolved in version 1.3.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: