-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fix useHookstate store switchover #409
base: master
Are you sure you want to change the base?
Conversation
afb51ed
to
f506584
Compare
ac337e2
to
139b9e2
Compare
Hi @speigg ... could you please let me know if you are planning to address my comments? |
Hi @avkonst I'd be happy to address your comments as soon as I have finished taking care of other things on my plate. Might take me another week to get to this. |
Should be good now. Apologies for the long delay. |
As I mentioned in a comment above, I removed the HOOKSTATE-106 warning entirely, as the warnings were excessive in our usage, and there are legitimate reasons for updating global state while a component unmounts (updating hooked global state on unmount). |
This PR adds support for store switchovers to useHookstate() for global and nested state. Local state behavior remains unchanged. Additionally, setting state after unmount no longer throws an error, which is more in line w/ how React's built-in useState hook works.
TLDR; Eliminated HOOKSTATE-111 and HOOKSTATE-106 exceptions.
closes #364