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

Deprecated Warning about PropTypes #48

Closed
iashraful opened this issue May 7, 2017 · 4 comments
Closed

Deprecated Warning about PropTypes #48

iashraful opened this issue May 7, 2017 · 4 comments

Comments

@iashraful
Copy link

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

I guess this is for defining const in index.js (root) file. Can you please help me get out from here?

@kaumac
Copy link

kaumac commented May 9, 2017

I tried to fix this one, but without knowing which components are causing this (there are several components with propType validation) I got lost.

I'm pretty sure this happens because on ui-router-react components, the proptypes are being defined like this:

import React from 'react';
const PropTypes = React.propTypes;
UISref.propTypes = {
	someProp: PropTypes.string,
	otherProp: PropTypes.bool
};

Not necessarily like this, but in a sense that the propTypes are being imported directly from the 'react' package, and as of React 15.5.x doing this will throw deprecation errors as there is a package just for this (https://www.npmjs.com/package/prop-types)

So it's not a problem on your code, it just need to be updated on ui-router-react

@kaumac
Copy link

kaumac commented May 9, 2017

#46 Seems to address the problem

@iashraful
Copy link
Author

@kaumac Thanks for nicely explaining. So, I should wait for ui-router-react update.

@elboman
Copy link
Member

elboman commented Jun 7, 2017

Yeah, sorry if I didn't update you back, but 0.5.0 version of @uirouter/react solves this warning.

@elboman elboman closed this as completed Jun 7, 2017
zdenekdrahos added a commit to costlocker/integrations that referenced this issue Aug 31, 2017
In ui-router 0.4 it's error because of superseded transition
Aborting was added in 0.5 (https://github.com/ui-router/react/releases)

React changes
- [x] deprecated props - ui-router/react#48
- [ ] deprecated cursor - omniscientjs/immstruct#89 (immstruct not released)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants