Enzyme: Warning Errors about PropTypes and React.createClass

Created on 14 Apr 2017  路  2Comments  路  Source: enzymejs/enzyme

React 15.5 when running tests i get the following errors.. i'm assuming its coming from enzyme..

I don't use createClass and have already upgraded to use PropTypes package in my component.

console.error node_modules/fbjs/lib/warning.js:36
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.

console.error node_modules/fbjs/lib/warning.js:36
Warning: A Component: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.

question

Most helpful comment

thanks @ljharb that did it.. can close.

All 2 comments

These warnings could be coming from anything in your entire dependency graph. You'll have to ensure everything in node_modules has updated, as well.

If you've updated to prop-types, then you won't get a warning for it from enzyme.

You have to have create-react-class as a dev dep with enzyme whether you use it or not, however, to avoid a warning from enzyme.

thanks @ljharb that did it.. can close.

Was this page helpful?
0 / 5 - 0 ratings