Skip to content
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

Class having render() and returning JSX no longer recognised as a component #280

Closed
worklez opened this issue Oct 30, 2015 · 2 comments
Closed

Comments

@worklez
Copy link

worklez commented Oct 30, 2015

This was the old behaviour, but has changed recently (#237 seems relevant). When there is a class that extends from component other than Component or React.Component, e.g.

class Button extends PureComponent {
  render() {
    const {text} = this.props;
    return <div>{text}</div>;
  }
}

Button.propTypes = {
  text: React.PropTypes.string.isRequired
};

it wouldn't be recognised as component and prop types wouldn't be validated.

@yannickcr
Copy link
Member

Yes, there was a few changes about component detection. There is still a few bugs (#267, #277) and I'm working on it.

@yannickcr
Copy link
Member

Should be fixed by 2749a0b in v3.7.0. Let me know if it's not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants