react-docgen
react-docgen copied to clipboard
fix(ts): parse prop types if component inhereited from a HOC
Supports doc generation for the following, pattern:
function MyHoc<T>(v: React.Component<T>) : React.Component<T> {
return v;
}
interface Props {
...
}
class MyComponent extends MyHoc(React.Component<Props>) {
render() {
return <div className='s-c-z-example'/>;
}
}
It's only a heuristic, and has the assumption that a function call in extends is a HOC and the first argument to Hoc is a React.Component like thing.
Note sure I this is something you'd support or if this implementation is ok or not.