Created
September 25, 2019 23:43
-
-
Save sagarpanda/8be95b6b5fd42ce6d70d93237b2545c8 to your computer and use it in GitHub Desktop.
Storybook config with ThemeProvider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // File: .storybook/config.js | |
| import { configure, addDecorator } from '@kadira/storybook'; | |
| import Theme from './../src/ui/theme'; | |
| import React from 'react'; | |
| import { ThemeProvider } from 'styled-components' | |
| function loadStories() { | |
| require('../stories'); | |
| } | |
| addDecorator((story) => ( | |
| <ThemeProvider theme={Theme}> | |
| {story()} | |
| </ThemeProvider> | |
| )) | |
| configure(loadStories, module); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment