Skip to content

no-unused-prop-types does not recognize use of prop inside Array.map() #819

@ghost

Description

In the following example, no-unused-prop-types will flag a non-use of arrayOfObjWithFoo.*.foo:

    static PropTypes = {
      arrayOfObjWithFoo: PropTypes.arrayOf(
        PropTypes.shape({ foo: PropTypes.string.isRequired })
      ).isRequired
    };

    render() {
      const fooItems = this.props.arrayOfObjWithFoo.map(objWithFoo => {
        <Item foo={objWithFoo.foo} />
      });
    }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions