react-docgen icon indicating copy to clipboard operation
react-docgen copied to clipboard

Error: No suitable component definition found using "export default ({}) => ..."

Open jmav opened this issue 7 years ago • 1 comments

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]

jmav avatar Apr 12 '18 22:04 jmav

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?

fkling avatar Jun 05 '18 21:06 fkling