react-docgen
react-docgen copied to clipboard
Error: No suitable component definition found using "export default ({}) => ..."
Following code reports Error: "No suitable component definition found using"
export default ({ SomeComponent }) =>
class Button extends Component {
static propTypes = {
label: PropTypes.string
};
render() {
return <SomeComponent />;
}
};
Removing arrow fn and options solves it:
export default
class Button extends Component {
static propTypes = {
label: PropTypes.string
};
render() {
return <SomeComponent />;
}
}
Any solution?
Using: react-docgen@v2 and [email protected]
Well, the function returned by the module is not a React component. It's a function that returns a React component. Did you expect Button to be documented found by react-docgen?