-
Notifications
You must be signed in to change notification settings - Fork 116
Fixed PropTypes deprecation of React 15.5 #57
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
Conversation
package.json
Outdated
@@ -20,7 +20,8 @@ | |||
"test": "karma start --single-run" | |||
}, | |||
"peerDependencies": { | |||
"react": ">=15 || ^0.14.7" | |||
"prop-types": "^15.5.8", | |||
"react": ">=15" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove || ^0.14.7
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since if someone uses react 14.x
he probably don't install the new prop-types
package which is needed with the new React.
I preferred not to do something like:
let PropTypes;
try {
PropTypes = require("prop-types");
} catch(e) {
PropTypes = require("react").PropTypes;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the prop-types
readme it looks like prop-types
should be a dependency and not a peer dependency and it is compatible with React 14 back to [email protected]
and React 15 back to [email protected]
therefore the react peer dependency could be "react": ">=15.3.0 || ^0.14.9"
package.json
Outdated
@@ -20,7 +20,8 @@ | |||
"test": "karma start --single-run" | |||
}, | |||
"peerDependencies": { | |||
"react": ">=15 || ^0.14.7" | |||
"prop-types": "^15.5.8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peer dependencies should be kept as loose as possible to make it easy for people using different versions. Let's use >=15
here, same as react
.
I've copy pasted since Github put it on "outdated": Since if someone uses let PropTypes;
try {
PropTypes = require("prop-types");
} catch(e) {
PropTypes = require("react").PropTypes;
} |
@mjackson Is the changes are okay? Is anymore thing to be done? |
@mjackson can you please merge this? it's really annoying to see the warning error from react :) |
This was fixed in #66 |
defaultMatches
not having propType