What is the use case / benefit for calling useStore twice? #2967
Unanswered
httpete-broadcom
asked this question in
Q&A
Replies: 4 comments 6 replies
-
If you have one combined useStore like this useFooStore(state => [state.bar, state.baz]) it will cause an infinite loop, unless you use |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you @dai-shi I meant like this in the example:
Why do two? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In this doc:
https://zustand.docs.pmnd.rs/hooks/use-store
You have two invocations of the useStore hook. Since they can always be combined to use one - what is the advantage of doing multiple picks?
Beta Was this translation helpful? Give feedback.
All reactions