We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Let's say I have a simple App:
render: function () { return ( <div id="app"> <Header></Header> <Content></Content> </div> ); }
Both my header and content need to change based on the current route.
I can think of one way of doing it by creating state containers for each route:
var routes = ( <Route name="app" handler={App} path="/"> <Route name="state1" handler={State1} /> <Route name="state2" handler={State2} /> </Route> ); var State1 = React.createClass({ getInitialState: function () { return { data: { headerthings: 'foo', contentthings: 'bar' } }; }, render: function () { return ( <Header things={this.state.data.headerthings} /> <Content things={this.state.data.contentthings} /> ); } });
But this seems less than ideal, as I'm having to manually manage all the routing state myself. What's the best way to handle this?
The text was updated successfully, but these errors were encountered:
#1008
Sorry, something went wrong.
No branches or pull requests
Let's say I have a simple App:
Both my header and content need to change based on the current route.
I can think of one way of doing it by creating state containers for each route:
But this seems less than ideal, as I'm having to manually manage all the routing state myself. What's the best way to handle this?
The text was updated successfully, but these errors were encountered: