Set react-docgen resolver to support styled-components
See original GitHub issueCurrently, the PropsTable
component does not recognize components made with styled-components
.
react-styleguidist
has the option to set a custom react-docgen resolver to fix this, as shown here: https://github.com/styled-components/styled-components/issues/945
Could we have something similar here? Or even better, to support styled-components
by default?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:6 (2 by maintainers)
Top Results From Across the Web
react-docgen-styled-component-resolver - npm
Start using react-docgen-styled-component-resolver in your project by ... const docgen = require('react-docgen'); const styledResolver ...
Read more >Automating React Documentation using React-Docgen ⚙️
It's a CLI and API that reads your React component files, grabs any documentation left in comments, and pumps out an object with...
Read more >Documenting components - React Styleguidist
Styleguidist generates documentation for your components based on the comments in your source code, propTypes declarations, and Readme files.
Read more >Tooling - styled-components
This option enhances the attached CSS class name on each component with richer output to help identify your components in the DOM without...
Read more >reactjs - Setup react-styleguidist, Create React App, Typescript ...
ReactExample /ReactExample ; js Module ; found: Can ; resolve 'rsg-components/Wrapper ; ' in '/Users ...
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
@Emilios1995 you should not add
babel-plugin-react-docgen
as it’s already in Docz. I am usingreact-emotion
styled-components and was able to get PropTypes descriptions by doing this:this seems like a simple workaround, maybe @pedronauck can close this issue.
P.S. is there a way to integrate this solution directly into Docz ? or may be we add custom resolvers to react-docgen setting in Docz?
This way nobody will have to type extra things, but also enabling styled-components support 😉
@ilyanoskov @antoniojps this is not really an option: doing so will break any styled-component functionality, as none of the properties from the styled-components will be available in the new wrapping component.