Skip to content

BottomSheets这个组件已经用了zustand,为什么还用provider传递一下? #12

Answered by lerte
fxwing asked this question in Q&A
Discussion options

You must be logged in to vote

其实不应该使用zustand的,直接使用react context就好了,后面有可能会移除zustand,当时我为了用zustand而用zustand,因为需要使用props初始化state,所以需要provider。https://docs.pmnd.rs/zustand/guides/initialize-state-with-props

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lerte
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
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #12 on December 29, 2023 10:33.