-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
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
Cannot render component through higher order component #65
Comments
This is something relative to babel-plugin-react-docgen, I tried to find some resolutions but I didn't get any results 😢 |
https://github.com/diegohaz/parse-prop-types can possibly help with that. |
But I need something that parses typescript and flow too @diegohaz, your package can do that? |
It doesn't. Unless there's something that transforms flow/typescript into PropTypes. |
I've been searching for a solution around transforming between various schema declarations (proptypes, flow, json schema, typescript) with little luck. Ended up baking my own for a project. However, this is the most promising library I have found to date that will automate moving from one to the other. https://www.npmjs.com/package/shapeshifter However, its trickier than it seems as the specs for each don't cleanly line up with each other (for example JSON Schema doesn't support functions). |
I have the same problem, and I was thinking about this : class _Button extends React.Component {
render() {
return(<button>{this.props.children}</button>)
}
}
const Button = HOC(_Button)
Button.propTypes = {
children: PropTypes.string
}
export default Button But it doesn't render PropsTable too. Is it related ? |
For plain ES / Flow, react-docgen recognizes HOC, but outputs type information for base components. (In I think it is needed to extend findAllExportedComponentDefinitions resolver to treat |
We are thinking about our structure to support HOC, because the DataServer parse just Components and docgen has a specific function to parse HOC. |
I'll close this since it will be also fixed with #240 when we can pass custom config to react docgen |
Bug Report
Cannot render component through higher order component
while exporting a component directly works fine, if a component is exported via a higher order component then the PropType table does not render
To Reproduce
SubTitle.propTypes = { error: PropTypes.bool }
)export default HOC(SubTitle)
)Enviroment
The text was updated successfully, but these errors were encountered: