You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I played around with this today. A major issue I'm encountering is that a lot of our components require context and Firebase data to render (e.g. the Projects component). I can workaround the issue by adding a storybook prop to the component and doing stuff like this:
Problem is, this will pollute our components with a lot of logic like IF props.storybook load dummy data, ELSE load data normally. Ideally I'd like to keep all Storybook logic inside the src/stories directory.
The text was updated successfully, but these errors were encountered:
Does Storybook allow you to provide a context to the components? If that's the case, we can provide a dummy/mock context. The unit tests are doing just that –– using "fakebase" and "fakesession" instead of the real things.
Storybook documentation: https://storybook.js.org/docs/guides/guide-react/
I played around with this today. A major issue I'm encountering is that a lot of our components require context and Firebase data to render (e.g. the Projects component). I can workaround the issue by adding a
storybook
prop to the component and doing stuff like this:Problem is, this will pollute our components with a lot of logic like
IF props.storybook load dummy data, ELSE load data normally
. Ideally I'd like to keep all Storybook logic inside the src/stories directory.The text was updated successfully, but these errors were encountered: