-
已经上了zustand而且在react中为什么使用createStore和useStore? |
Beta Was this translation helpful? Give feedback.
Answered by
lerte
Dec 29, 2023
Replies: 2 comments
-
其实不应该使用zustand的,直接使用react context就好了,后面有可能会移除zustand,当时我为了用zustand而用zustand,因为需要使用props初始化state,所以需要provider。https://docs.pmnd.rs/zustand/guides/initialize-state-with-props |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lerte
-
ok 了解了 |
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
其实不应该使用zustand的,直接使用react context就好了,后面有可能会移除zustand,当时我为了用zustand而用zustand,因为需要使用props初始化state,所以需要provider。https://docs.pmnd.rs/zustand/guides/initialize-state-with-props