Reputation: 1351
I have been getting the warning in my console about deprecation of Proptypes directly from React.
bundle.js:9748 Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more...
So, I installed prop-types per the Facebook github page, and migrated the code.
npm install --save prop-types
But the warning did not go away since I did not have React and React-dom 15.3 so I upgraded them both. After which, I got the error and my app stopped running:
Error: Cannot find module object-assign
I tried installing object-assign but that did not get rid of the error or get the app running again.
npm install object-assign --save-dev
How can I fix this problem and get rid of the Proptypes console warning?
Upvotes: 2
Views: 4000
Reputation: 1351
The error was due to a node module that was not fully upgraded. I searched the entire node modules directory using the search function on atom for "PropTypes } from 'react'" and react-router-dom came up. I upgraded the package to the most recent one and the warning was gone.
Upvotes: 1
Reputation: 1842
Well the warning seems like you are importing Proptypes
directly from react
rather than using prop-types
. If you change to use the Proptypes
from prop-types
package/module, it should fix the issue.
Upvotes: 0