Skip to content

Zustand and Storybook #2626

Answered by dbritto-dev
sourire123 asked this question in Q&A
Discussion options

You must be logged in to vote

@sourire123 you can use storybook decorators to do that. For instance if you are using Context API you can wrap your components with a decorator to initialize the data or you can use useEffect and useYourStore.setState to do the same.

Ref: https://storybook.js.org/docs/writing-stories/decorators#context-for-mocking

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sourire123
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