Skip to content

PropTypes.oneOf warning does not include expected types #1919

@jgebhardt

Description

@jgebhardt

PropType warnings for oneOf say null instead of the actual expected type.

For example, for this PropType:

  name: React.PropTypes.oneOf([
      React.PropTypes.number,
      React.PropTypes.component
   ])

I get the following warning:

Warning: Invalid prop `name` of value `World` supplied to `Hello`, expected
one of [null,null].

Example: http://jsfiddle.net/jxg/N76tr/

React v.0.11.0

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