External Selector Does Not Trigger State Change #2536
Unanswered
elson-currentcorp
asked this question in
Bug report
Replies: 1 comment
-
|
Okay, this is interesting. I don't think you are doing anything wrong. Zustand v5-alpha actually works fine. It seems like a bug in useSyncExternalStoreWithSelector. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a modal that uses the states
value,setValue,isOpenandsetIsOpenlocated in the store. Whenever this modal is opened, I want to reset the input field to be whatever the currentvaluein the store is. The user can edit the input field, this does not affect the storedvalueuntil the user clicks save.This is my basic implementation:
https://codesandbox.io/p/sandbox/amazing-rhodes-forked-ydqmgd?file=%2Fsrc%2FApp.tsx%3A46%2C1
Why does line 42 work, but not line 45? The modal open state does not change if I use a external selector even though the state changes.
Beta Was this translation helpful? Give feedback.
All reactions