Skip to content

Zustand and Storybook #2626

Answered by dbritto-dev
sourire123 asked this question in Q&A
Jul 1, 2024 · 1 comments · 9 replies
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 9 replies

Comment options

You must be logged in to vote
9 replies
@dbritto-dev
Comment options

@dbritto-dev
Comment options

@clianor
Comment options

@dbritto-dev
Comment options

@clianor
Comment options

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
3 participants