4.4.8 throws PropTypes validation warnings for React 14
See original GitHub issueFor every component we use ‘connect’ in, we get the following JS warning on every render:
Warning: Failed Context Types: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types Check the render method of `[NAME OF COMPONENT]`
Right now, each page load brings about 2000 of these warnings.
For example, using the following component throws warnings:
import React, { Component } from 'react'
import { connect } from 'react-redux'
class FeedCard extends Component {
render() {
return <div />
}
}
export default connect(null, {
updateFeedItem,
})(FeedCard)
But simply removing the ‘connect’ usage “fixes” the problem (although it renders the component useless):
import React, { Component } from 'react'
import { connect } from 'react-redux'
class FeedCard extends Component {
render() {
return <div />
}
}
export default FeedCard
I confirmed that downgrading to 4.4.7 makes the issue go away. We are using React 0.14.8
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Don't Call PropTypes Warning - React
Once this happens, any code that calls these functions manually (that isn't stripped in production) will throw an error. Declaring PropTypes is still...
Read more >React eslint error missing in props validation - Stack Overflow
I got this error because I copied and pasted the object from a different with a slightly different name and forgot to change...
Read more >error 'children' is missing in props validation react/prop-types
It's because you are exporting the stateless component directly without any variable holding it meanwhile you are creating propTypes and defaultProps for ...
Read more >prop-types - npm
Runtime type checking for React props and similar objects. ... standalone prop-types , all validator functions will start throwing an error ...
Read more >React eslint error missing in props validation - SyntaxFix
I have the next code, eslint throw: react/prop-types onClickOut; is missing in props validation. react/prop-types children; ... Asked on 2016-07-31 14:19:33 ...
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 FreeTop 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
Top GitHub Comments
Okay,
react@0.14.9
andreact-dom@0.14.9
are out, and they should play nice withprop-types
. Other React-related packages were not updated. Let me know if it helps.Look at Dan go!
Looks like the issue is upstream with React itself, so I’m closing this one out.