Skip to content

prop-types does mark nested destructured props as being used #296

Closed
@kolodny

Description

@kolodny

Assume I have a propTypes as follows:

propTypes: {
  foo: PropTypes.number,
  bar: PropTypes.shape({
    faz: PropTypes.number,
    qaz: PropTypes.object,
  }),
};

I would want accessing this.props.bar.faz to not generate an error, while this.props.bar.nope to generate an error.

This may be tricky because PropTypes.shape is technically a black box, but when used with something like recursive from https://github.com/kolodny/zan it would make sense

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions