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

useSubscription unsubscribes after the first render #232

Open
performanceArtist opened this issue Sep 19, 2020 · 2 comments
Open

useSubscription unsubscribes after the first render #232

performanceArtist opened this issue Sep 19, 2020 · 2 comments

Comments

@performanceArtist
Copy link

useSubscription doesn't work - useMemo creates the subscription during the first render, but then useEffect unsubscribes after the component has mounted(there are no deps in useEffect call). Also I think useMemo should not be used for the subscription effect - it can trigger other effects before the initial rendering is complete. I have a case where it messes up some DOM manipulations. The solution would be using useEffect both for the subscription effect and the cleanup.

@scink
Copy link
Contributor

scink commented Oct 19, 2020

any progress here?

@performanceArtist
Copy link
Author

I don't quite understand how to make a contribution - I'm getting 403 status error when I'm trying to push a new branch. Should I fork the repo? Other than that, the obvious solution would be to add [] to useEffect dependencies.

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

2 participants