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

Possible regression: props passed to routes lost #28

Closed
bjyoungblood opened this issue Jun 16, 2014 · 6 comments
Closed

Possible regression: props passed to routes lost #28

bjyoungblood opened this issue Jun 16, 2014 · 6 comments

Comments

@bjyoungblood
Copy link

As of ef8bfba, it was possible to pass extra props to routes. On the current master, this no longer appears to work. Has this functionality been intentionally removed, and if so, is there another way to pass extra props into routes?

@mjackson
Copy link
Member

Extra props (i.e. not handler, name, or path) that are passed to <Route> components should still be passed to their handlers. Can you post some sample code or even better a failing test that demonstrates this is failing?

@mjackson
Copy link
Member

I should also mention that key, params, query, and activeRoute are reserved prop names, so if your "static" props are named any of those they will be overwritten.

@bjyoungblood
Copy link
Author

I was mistaken. It's actually just the top-level route that does not receive static props. #29 has a failing test and a fix.

@mjackson
Copy link
Member

@bjyoungblood Awesome. Thank you. I'll follow up on #29.

@torgeir
Copy link

torgeir commented Nov 23, 2014

Extra props (i.e. not handler, name, or path) that are passed to components should still be passed to their handlers.

@mjackson Does this mean that the following ought to be working? https://gist.github.com/torgeir/7d14a2b42019603aef1e

@abergs
Copy link
Contributor

abergs commented Nov 25, 2014

For others encountering this; @torgeir behavior changed in 0.11, see https://github.com/rackt/react-router/blob/master/UPGRADE_GUIDE.md#route-props-passed-to-handlers

@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 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

Successfully merging a pull request may close this issue.

4 participants