Cannot render component through higher order component
See original GitHub issueBug 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
- set PropType (e.g.
SubTitle.propTypes = { error: PropTypes.bool }
) - export component as via higher order component (e.g.
export default HOC(SubTitle)
) - PropType table does not appear
// basic HOC() for demonstration
import React from 'react'
export default (HOC) => {
return class ReactHOC extends React.Component {
render() {
return <HOC {...this.props}/>
}
}
}
Enviroment
- OS: OSX 10.13.3
- Node: v8.9.4
- NPM: v6.0.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Higher-Order Components - React
A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per...
Read more >React higher-order component - Warning: Cannot update a ...
I am using a fully immutable Redux store and do not use any non-functional components. I am afraid that because I am getting...
Read more >Introduction to Higher-Order Components in React by example
We use higher order components to primarily reuse logic in React apps. However, they have to render some UI. Hence, HOCs are inconvenient...
Read more >Understanding React higher-order components
A higher-order component is a function that takes in a component and returns a new component. Using code, we can rewrite the above...
Read more >Higher-Order Components in React js - Topcoder
React provides us with a technique to reuse component logic. This is an advanced technique called higher-order component, or HOC.
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
It doesn’t. Unless there’s something that transforms flow/typescript into PropTypes.
I’ll close this since it will be also fixed with #240 when we can pass custom config to react docgen