-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Storybook v7 #61
Comments
For anyone hitting this issue, I tried the new way of adding decorators as described here but its throwing errors so this library does not work with storybook 7 yet. As alternative, you could look into this styled components recipe on storybook documentation, where they use Add a decorator to stories in .storybook/preview.js import { Preview } from '@storybook/react';
import { withThemeFromJSXProvider } from '@storybook/addon-styling';
import { createGlobalStyle, ThemeProvider } from 'styled-components';
import { theme1, theme2 } from './themes';
const GlobalStyles = createGlobalStyle`
// some global style if needed
`;
const preview: Preview = {
decorators: [
withThemeFromJSXProvider({
themes: {
theme1,
theme2,
},
defaultTheme: 'theme1',
Provider: ThemeProvider,
GlobalStyles,
}),
],
};
export default preview; Add to .storybook/main.js
|
That is awesome, thanks Vincent you saved my day! |
In storybook v7,
addDecorator
has been removed.The text was updated successfully, but these errors were encountered: