create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

React.createClass is deprecated in create-react-app

Open shabanraza opened this issue 9 years ago • 3 comments

I have created a project using create-react-app but when i run the cmd npm start then console showing two warning msg

warning.js:36 Warning: OutboundLink: 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

warning.js:36 Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead

shabanraza avatar Apr 12 '17 12:04 shabanraza

look here for more info https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html

viankakrisna avatar Apr 12 '17 12:04 viankakrisna

It means that OutboundLink should be migrated to either ES6 classes or create-react-class package. It’s not urgent, but React.createClass is being moved from React 16 into a separate package, so you need to update the code (or file an issue with the library that OutboundLink is coming from). I hope this helps! See more details in the blog post linked above.

gaearon avatar Apr 12 '17 13:04 gaearon

My issue was related to react-router. If you are using 3.x, make sure to update to 3.04 or higher. If you're on 4.x, update to 4.1.1.

jmlivingston avatar May 26 '17 04:05 jmlivingston