We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug I have created react typescript app with Crate React App and integrated Storybook.
In the storybook preview.js:
preview.js
import React, { Fragment } from 'react'; import { addDecorator } from '@storybook/react'; import { ThemeProvider } from 'styled-components'; import { GlobalStyle, theme } from '../src/theme'; addDecorator(story => ( <ThemeProvider theme={theme}> <Fragment> <GlobalStyle /> {story()} </Fragment> </ThemeProvider> ));
The component works fine in Canvas tab but gives error in Docs tab.
In Button.tsx
Button.tsx
const Button = styled.button` background-color: ${props => props.theme.color.primary}; `; In Docs tab, the theme object is undefined but works in Canvas tab.
The issue occurs in Button.stories.mdx but does not occur if we create Button.stories.tsx file.
Button.stories.mdx
Button.stories.tsx
The text was updated successfully, but these errors were encountered:
Can you show me Button.stories.tsx and Button.stories.mdx too?
Sorry, something went wrong.
Aha looks like you fixed it 👍
@shilman I reinstalled storybook and all storybook integrations from beginning and the error seems to be fixed.
No branches or pull requests
Describe the bug
I have created react typescript app with Crate React App and integrated Storybook.
In the storybook
preview.js
:The component works fine in Canvas tab but gives error in Docs tab.
In
Button.tsx
The issue occurs in
Button.stories.mdx
but does not occur if we createButton.stories.tsx
file.The text was updated successfully, but these errors were encountered: