You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent a few hours trying to track down a bug. And I was convinced that createStore must have been caching my results across re-renders. Then I realized the cached value was the default state value I passed as an argument when initializing the store. I think it would be nice to have a note about this in the documentation.
I made an example with a fork in Codesandbox. I am not a word smith, so any suggested improvements would be welcome.
If you agree, I would be happy to push up the changes and make a PR.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I spent a few hours trying to track down a bug. And I was convinced that
createStore
must have been caching my results across re-renders. Then I realized the cached value was the default state value I passed as an argument when initializing the store. I think it would be nice to have a note about this in the documentation.I made an example with a fork in Codesandbox. I am not a word smith, so any suggested improvements would be welcome.
If you agree, I would be happy to push up the changes and make a PR.
Beta Was this translation helpful? Give feedback.
All reactions