Skip to content

Difference between useStore and store.getState() #2194

Closed Answered by dai-shi
henryfung3a27 asked this question in General
Discussion options

You must be logged in to vote

store.getState() is to read the store state in vanilla. You need to use useStore to have a reactive value in React. In other words, if store.getState() just works, it's good to go.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@henryfung3a27
Comment options

@gsouf
Comment options

@henryfung3a27
Comment options

@dai-shi
Comment options

@gsouf
Comment options

Answer selected by henryfung3a27
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants