useStore of a vanilla store sometimes doesn't react to updates #2467
Unanswered
elieven
asked this question in
Bug report
Replies: 1 comment
-
|
Can't see the codesandbox, but it sounds like you mutate the object, where you should treat it immutably, just guessing. |
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.
-
I'm making use of vanilla stores (multiple may be created and passed down to children via context) that connect to various remote updates. There seem to be some cases where
useStoreworks and some where it doesn't while using these vanilla stores.I think this is most likely due to some misunderstanding I have about the workings but you never know.
I am not even entirely sure how to describe what the situation is where it doesn't work so forgive me - but I'll ask you to look at two minimal reproductions side by side.
Here is the working version one - the value of the context is the store directly and in this case
useStoreworks and the UI updates. And here is the one that does not work. The only difference here is that the store is inside an object.Strangely enough sometimes it randomly starts working and updating when the codesandbox or local hot module replacement kicks in.
Any idea what might be the problem?
Beta Was this translation helpful? Give feedback.
All reactions