r/reactjs•
Griffinsauce

How do you deal with state and redux in storybook?

Hi, we have a setup with some global stuff in redux and the rest of the state just in components. I'm struggling a bit with how to arrange things so we can use storybook for quick UI iterations.

Storybook seems to mostly want completely static, presentational components but especially with the useSelector hook it feels very boilerplatey to have a wrapping component just for that and a presentational component for the actual layout (just adding 1 line makes the presentational component listen to the store)

The same goes for useState. Do you have any advice for this?

Posted Aug 27, 2019, 6:00 AM UTC

610
Loading comments…