-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
How would I pass props from a parent route to the children in 1.0.0-beta2 #1369
Comments
React.cloneElement(this.props.children, { appState: this.state }); There's also |
@taurose, so |
Yeah, you can use it to pass props to all your route handlers. You can also access the component class and the route state to make decisions. http://rackt.github.io/react-router/tags/v1.0.0-beta2.html#Router |
Cool, I used |
I've been look around all over, but haven't been able to figure it out.
This is what I thought should work, but having no success logging out the prop in the render method of the component. Any ideas on what I'm doing wrong here? |
Thanks for your question! We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router. Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router. We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46. |
My "App" component computes some values based on the window, and then passes them down to the child routes. In 0.13 I would just do this
But now that we use
this.props.children
to inject the child route into the parent, I'm a little uncertain how to accomplish the same thing.The text was updated successfully, but these errors were encountered: