React-md: Migrate from React.PropTypes to prop-types

Created on 9 Apr 2017  路  8Comments  路  Source: mlaursen/react-md

Hi, I'm gettting this errors

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

Warning: Motion: 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.

How can I fix them?

enhancement

Most helpful comment

We can simply wait for @mlaursen to fix it.

The warning is not serious right now, your app will work fine.

All 8 comments

Hi,

I think this is due to the next react upgrade. React.PropTypes will be deprecated and replaced by a standalone package prop-types.

You can find the deprecation notice on the react documentation page.

Deprecation notice

To sum up

import { PropTypes } from 'react';
//need to be replaced by
import PropTypes  from 'prop-types';

hi,
from what I see in devtools console, the errors seem to come from Card.js and Motion.js in the md package

We can simply wait for @mlaursen to fix it.

The warning is not serious right now, your app will work fine.

@leedstyh just spent some time playing with the components. They seem to be working fine

Yeah, I'm a little unsure about how to handle this migration. I'll need to wait for react-motion to update and also figure out what the new convention for the prop-types is. Is this another peerDependency like react/react-dom, or is it more static so I can just use it as a local devDependency?

Hi, when will these changed be merged with the main branch? Currently my Jest snapshot tests are not working because of this.

Please take your time, I don't mean to be impatient, it's just for planning ahead. :smile:

Right now, I am unable to merge due to this bug in the new react-transition-group. Once it has been fixed, I'll do a patch with this changes as well. So hopefully really soon!

Thanks for the information!

Was this page helpful?
0 / 5 - 0 ratings