Skip to content

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

Closed
wants to merge 5 commits into from

Conversation

oriSomething
Copy link

  • Moreover, fixed small linting issue of defaultMatches not having propType

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"
Copy link
Member

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?

Copy link
Author

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

Copy link

@danhayden danhayden May 1, 2017

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",
Copy link
Member

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.

@oriSomething
Copy link
Author

I've copy pasted since Github put it on "outdated":

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

@oriSomething
Copy link
Author

@mjackson Is the changes are okay? Is anymore thing to be done?

@deiucanta
Copy link

@mjackson can you please merge this? it's really annoying to see the warning error from react :)

@mjackson
Copy link
Member

This was fixed in #66

@mjackson mjackson closed this Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants