"StyledComponent" Component - No propTypes defined!
See original GitHub issueAfter upgrading from Storybook 4.x.x to 5.0.6., I am not able anymore to see the assigned propTypes for Styled Components in Storybook anymore.
That’s what I see in Storybook:
That’s what I have coded:
const TabBar = styled.div`
display: flex;
flex-direction: column;
`;
TabBar.displayName = 'TabBar';
TabBar.propTypes = {
children: PropTypes.arrayOf(
PropTypes.shape({
type: PropTypes.oneOf([TabBar.ContentTab]),
}),
).isRequired,
};
And I would expect to see the children prop types instead.
Note: It works for other components which haven’t defined with styled components though.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:16 (9 by maintainers)
Top Results From Across the Web
"StyledComponent" Component - No propTypes defined! #6417
After upgrading from Storybook 4.x.x to 5.0.6., I am not able anymore to see the assigned propTypes for Styled Components in Storybook anymore....
Read more >How to declare "propTypes" for styled-component?
MyLib.tsx. import PropTypes from 'prop-types' import styled from 'styled-components' const Scroller: any = styled. div<ScrollerProp>` overflow- ...
Read more >API Reference - styled-components
A function that receives the props that are passed into the component and computes a value, that is then going to be merged...
Read more >styled-components - npm
styled -components is compatible with both React (for web) and React Native – meaning it's the perfect choice even for truly universal apps!...
Read more >Component prop types are not inferred when using styled ...
Expect to see someProp, instead no props are shown. ... We don't have any completions even if we do not use generic parameters....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@oknoorap Nope, will comment here when it is. If anybody else wants to take a crack at it, they’re more than welcome!
@shilman This may also be related to the bug I logged for the missing prop table in TypeScript: https://github.com/storybooks/storybook/issues/6345