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

Exported PropTypes object only includes { history, location, router }, breaking semver #3342

Closed
grrowl opened this issue Apr 18, 2016 · 3 comments
Milestone

Comments

@grrowl
Copy link

grrowl commented Apr 18, 2016

After perusing the PropTypes documentation, the relevant code, and the offending PR and related PropTypes commit and related docs commit, which doesn't actually match up with the offending PropTypes change.

The change landed in 2.2.0, described as only "Minor: Update PropTypes"

@grrowl
Copy link
Author

grrowl commented Apr 18, 2016

Also, relating to #3218,

route and routes are set up for internal use rather than external use (e.g. route will never be an element as supplied to a route component)

PropTypes.routes will match routes as passed down to matched route/container components as property routes (and itself is no more than oneOfType([ route, arrayOf(route) ])). If there's upcoming API changes where this isn't the case, the PropTypes changes belong in that version

@taion
Copy link
Contributor

taion commented Apr 18, 2016

@grrowl

That actually illustrates the exact problem with the current PropTypes setup, and why we need to change it. It's currently a confusing assortment of internal and external prop types. routes in that context refers not to what your component receives, but to the acceptable prop taken by <Router>. It's not the routes prop injected into route components.

You're right that we shouldn't have taken these out without a major bump, but these need to go away anyway. I'm thinking that routerShape is the only one we can keep.

@taion taion added this to the next-2.3.0 milestone Apr 18, 2016
@timdorr timdorr closed this as completed Apr 18, 2016
@taion
Copy link
Contributor

taion commented Apr 18, 2016

Restored on 2.3.0, but with deprecations. Please use routerShape and locationShape; the other prop types were not meant to be used externally.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants