Skip to content

React PropTypes warning with LayoutAnimation #12458

@janicduplessis

Description

@janicduplessis

We are calling PropTypes manually in LayoutAnimation which now triggers a warning since React 16. https://facebook.github.io/react/warnings/dont-call-proptypes.html explains the warning but there doesn't seem to be an ideal solution in our case, including a new dependency to do these validations seems a bit overkill and writing these validations manually a bit too complex.

Opening this issue to discuss what would be the best situation here. Some ideas...

  • Write the validation manually
  • Use a validation library that is pretty much the react prop types checker without the warning like https://github.com/developit/proptypes
  • Use console.ignoredYellowBox to silence the warning.
  • Include the React secret in RN and use it to silence the warning.

cc @gaearon @sebmarkbage

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