Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up effects when component unmount #37

Open
fnick851 opened this issue Feb 19, 2021 · 0 comments
Open

Clean up effects when component unmount #37

fnick851 opened this issue Feb 19, 2021 · 0 comments

Comments

@fnick851
Copy link

I am using the library with Next.js and when I navigate to a different page for the first time I get this error:

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.
    at ControlsProvider (webpack-internal:///./node_modules/react-three-gui/dist/react-three-gui.esm.js:89:23)
    at DebugUIScene
    at LoadableComponent (webpack-internal:///./node_modules/next/dist/next-server/lib/loadable.js:187:37)
    at div
    at div
    at div
    at Layout (webpack-internal:///./components/Layout.tsx:28:23)
    at DebugUI

I think it is because the library does not clean up side effects when component unmounts. But it also could be a specific issue that only happen with such server-side rendered / isomorphic frameworks.

Could you confirm if this is a bug? Or is there a way to get around this?

If you need a reproduction project I can set one up. Please let me know. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant