Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from React.PropTypes to prop-types #325

Closed
folivi opened this issue Apr 9, 2017 · 8 comments
Closed

Migrate from React.PropTypes to prop-types #325

folivi opened this issue Apr 9, 2017 · 8 comments
Milestone

Comments

@folivi
Copy link

folivi commented Apr 9, 2017

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?

@fkhadra
Copy link
Contributor

fkhadra commented Apr 9, 2017

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';

@folivi
Copy link
Author

folivi commented Apr 9, 2017

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

@leedstyh
Copy link

leedstyh commented Apr 9, 2017

We can simply wait for @mlaursen to fix it.

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

@folivi
Copy link
Author

folivi commented Apr 9, 2017

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

@mlaursen
Copy link
Owner

mlaursen commented Apr 11, 2017

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?

@mlaursen mlaursen changed the title proptype error Migrate from React.PropTypes to prop-types Apr 11, 2017
@mlaursen mlaursen added this to the v1.1.0 milestone Apr 11, 2017
mlaursen added a commit that referenced this issue Apr 20, 2017
With the React 15.5 changes, moved the PropTypes from the main package
to prop-types.

References #325
mlaursen added a commit that referenced this issue Apr 20, 2017
Merged over from react-addons-css-transition-group and
react-addons-transition-group to the new react-transition-group package.

References #325
@joseds
Copy link

joseds commented Apr 28, 2017

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. 😄

@mlaursen
Copy link
Owner

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!

@joseds
Copy link

joseds commented Apr 28, 2017

Thanks for the information!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants