Skip to content

How to get state data just after setting it #1414

Closed Answered by dai-shi
shellking4 asked this question in Q&A
Discussion options

You must be logged in to vote

You can read the store value directly in a callback. useAuthStore.getState().authUser
That said, deriving the global state to a local state seems like a bad practice. You should avoid the useState there.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shellking4
Comment options

@tylerrrkd
Comment options

Answer selected by shellking4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants