styled-components: ThemeProvider breaks react-storybook
I’d appreciate any pointers as I’m not sure where things break down when using styled-components ThemProvider with react-storybook. I only experience this problem when wrapping the styled component in ThemeProvider. I created a minimal example repo that demonstrates the problem I’m experiencing:
https://github.com/amsb/storybook_styled-components_example
Here’s what happens when I attempt to navigate in storybook after viewing a styled component wrapped in ThemeProvider:

Same behavior if I remove the AddOn and directly wrap the component in ThemeProvider in the story itself. Maybe some conflict with context management when using ThemeProvider that blocks updates? There are no errors in the console.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (8 by maintainers)
@kopax https://gist.github.com/vernondegoede/0575d268d52e00f221cc86057fb938d1
Yes, it’s working fine. Just use the
addDecoratormethod which comes with react-storybook./cc @arunoda @mnmtanish, maybe you have some input about how you’re using context before I find time to dig in?