Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make a note that createStore mutates its args #1279

jb-1980 started this conversation in Ideas
Discussion options

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.

image

If you agree, I would be happy to push up the changes and make a PR.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /