Skip to content

Missing Proptypes rule does not go inside if inside the render #144

Closed
@micaste

Description

Hi,

I noticed that the props check rule does not go inside a if inside a render method. Here is my use case :

render() {
  if (...) {
    return <B x={this.props.x} y={this.props.y} />;
  } else {
    return <A />;
  }
}

With this code I have no 'Missing PropTypes' warning for x and y, but when I remove the if and just return, I have the warning (as expected).

Thanks

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions