As on subject how can I get the route name inside the handler? For example:
var routes = <Route handler={App} path="/">
<Route name="home" path="/home" handler={HomePage} />
<DefaultRoute handler={HomePage} />
</Route>
Router.run(routes, function(Handler, state) {
var params = state.params;
React.render(<Handler params={params}/>, document.body);
});
Now suppose I have a component like this:
class HomePage extends React.Component {
render() {
return(<div>MyComponent</div>)
}
}
how can I get the current route name? To be more specific I want to get the
name="home"
attribute from
<Route name="home" path="/home" handler={HomePage} />