question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React PropTypes warning with LayoutAnimation

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
grabboucommented, Apr 5, 2017

I will cherry pick this ASAP as soon as I get to work, approx 2 hours.

On Wed, Apr 5, 2017, 01:31 Dan Abramov notifications@github.com wrote:

For people encountering the warning: please feel free to ignore it http://facebook.github.io/react-native/docs/debugging.html#warnings for now. Sorry this slipped through.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/12458#issuecomment-291670683, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWcxnMAhGnSeedNXpCBD6HifP1irWORks5rstLkgaJpZM4MFZbR .

3reactions
janicduplessiscommented, Mar 17, 2017

Also I have a PR already to fix this, should get merged soon and then we can include the fix in the next rc patch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[0.45.0] checkPropTypes warning on LayoutAnimation ...
On call LayoutAnimation.easeInEaseOut() in React native 0.45.0 occurs next warning: Warning: ... Use the prop-types package on npm instead.
Read more >
Don't Call PropTypes Warning - React
Don't call PropTypes directly. Using PropTypes in any other way than annotating React components with them is no longer supported: var apiShape =...
Read more >
Props and PropTypes | Mastering React Native
Adding PropTypes to a component does not change anything functionally, but it will cause annoying warning messages to be logged to the JavaScript...
Read more >
PropTypes - react - Web Coding Center
RESETRUNFULL import PropTypes from 'prop-types';MyComponent.propTypes = { // You can declare that a prop is a specific JS type.
Read more >
react-native-layout-animation-provider - Morioh
import React from 'react'; import PropTypes from 'prop-types'; import { View, ... Dimensions, ScrollView, LayoutAnimation, Alert, } from 'react-native'; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found