Skip to content

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

Closed
@micaste

Description

@micaste

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

Metadata

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