encapsulating store within a hook #2767
Unanswered
jestrickler
asked this question in
Q&A
Replies: 2 comments
-
@jestrickler yeah, that should work. Let us know if doesn't work. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It worked after I moved 'useZustandStore = create...' outside of the hook, so it's not creating a new store every time the hook is called, D'oh!! But I wonder if this is the same as fetching everything - const state = useZustandStore(), since the hook returns all the slices, and the component destructures the items it needs..? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would the following work?
Beta Was this translation helpful? Give feedback.
All reactions