propTypes not informing description
See original GitHub issueDescribe the bug
Probably not a bug, but I can’t figure out docspage esp in regards to slot proptypes informing description
and
To Reproduce
/**
* some cool docs
*/
export const Button = (props) => {
return <Cb {...props} />
}
Button.propTypes = {
actionType: PropTypes.oneOf(['positive', 'negative', 'neutral', 'error', 'warning']),
};
Expected behavior Something like this
Actual
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:14 (3 by maintainers)
Top Results From Across the Web
Eslinter not detecting Defined prop-types for react component
The error message is saying that it can't find that rule. Since the prop-types rule is provided by a plugin, eslint-plugin-react , and...
Read more >Typechecking With PropTypes - React
To run typechecking on the props for a component, you can assign the special propTypes property: import PropTypes from 'prop-types'; class Greeting extends ......
Read more >Typechecking with PropTypes, Flow and TypeScript
Typechecking is a simple method to avoid potential errors in an application. We have talked about basic principles to avoid potential errors, ...
Read more >ReactJs Typechecking with PropTypes | Ultimate Guide
When creating a React application, you may find that a prop needs to be structured and described to avoid faults and failures. A...
Read more >Code components API reference | Learn Plasmic
description, No, A human-friendly description for what this component does; will be rendered as a helpful ... type, Yes, One of the supported...
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
Took me a bit, but I did eventually figure out how to get
react-docgen
running on the project by adding it to our custombabelrc
file.For what it’s worth, I’m seeing more or less the same issue with my component and I’m definitely not using CRA, so unsure if that bug would affect my use-case.
This is what I end up with:
I did at least get one step closer than the original author by setting
Button.defaultProps
to get the defaults column working, but the descriptions are a no-go both in textual description and for showing the actual types.