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
Hey,
I am using storybook (with info addon) at web React app. At the same app I am using styled components (https://www.styled-components.com/).
Here is simple case how I am doing this:
LayoutHeader.js
import styled from 'styled-components'; const LayoutHeader = styled.div` color: #fff; background-color: #000; `; export default LayoutHeader;
LayoutHeader.story.js
import { storiesOf } from '@storybook/react'; import React from 'react'; import LayoutHeader from './LayoutHeader'; storiesOf('LayoutHeader', module) .addWithInfo('with text', () => ( <LayoutHeader>Simple text</LayoutHeader> ));
The problem is the storybook info output looks like this:
Can I somehow process the story so it renders story content as <LayoutHeader /> instead of <styled.div />?
<LayoutHeader />
<styled.div />
The text was updated successfully, but these errors were encountered:
I am sorry, my question was too hasty.
The solution is:
import styled from 'styled-components'; const LayoutHeader = styled.div` color: #fff; background-color: #000; `; LayoutHeader.displayName = 'LayoutHeader'; export default LayoutHeader;
Sorry, something went wrong.
@michaltaberski Thank you for sharing your case! Perhaps it'd be useful for someone! I guess we can close it.
No branches or pull requests
Hey,
I am using storybook (with info addon) at web React app. At the same app I am using styled components (https://www.styled-components.com/).
Here is simple case how I am doing this:
LayoutHeader.js
LayoutHeader.story.js
The problem is the storybook info output looks like this:
Can I somehow process the story so it renders story content as
<LayoutHeader />
instead of<styled.div />
?The text was updated successfully, but these errors were encountered: