React PropTypes warning with LayoutAnimation
See original GitHub issueWe 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.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:16 (11 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
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.