Skip to content

forbid-foreign-prop-types should allow another component's propTypes in a propTypes definition #1647

Closed
@iansu

Description

@iansu

Currently this results in a warning but shouldn't:

Button.propTypes = {
  ...Touchable.propTypes,
  color: PropTypes.string
}

The error message could also be improved to explain why using another component's propTypes is bad. For example: "Using propTypes from another component is not safe because they may be removed in production builds".

Comments via @gaearon on this issue: facebook/create-react-app#3818

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