-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
useStore stops firing on state changes after component remounts #86
Comments
Downgrading to 2.2.1 seems to fix this issue. Tested by downgrading the zustand package in the above codesandbox. |
Dug in a little and it seems that subscribers are indeed being overwritten like in #84, in this case the child gets assigned same index as its parent. What about compressing the subscribers array right after adding a subscriber?
|
I have the same problem |
me too |
me too! HELP ZUSTAND TEAM |
Any news on this? Seems to still be a problem |
@dentrado On version 2.2.1, everything is fine |
But then I get the bug they fixed in 2.2.2 instead |
@dentrado very sadly ( |
When switching between mounting two components that both calls the useStore hook, where one of them conditionally mounts a child that also calls useStore, the parent will stop rendering on state changes after remounting. Here's a minimal example on codesandbox:
https://codesandbox.io/s/nostalgic-hooks-0x63r
Repro steps are included. Let me know if you want the code pasted here instead.
Could this be related to #85 ?
edit: updated codesandbox link, messed around in the original one I posted without realizing it.
The text was updated successfully, but these errors were encountered: