I have this snippet of code that toggles between different components. I would like to pass values down to the different components in an easy way, like this;
<Route path="student" component={Student} websocket={self.websocket}/>
Is there an easy way of doing this? I have looked at cloning classes etc, but I don't think those answers are "good enough" I guess. I haven't found a similar situation and hope someone can answer my question.
The code in "full";
ReactDOM.render(
<Router history={browserHistory}>
<Route path="/" component={App}>
<Route path="student" component={Student}/>
<Route path="about" component={About}/>
<Route path="login" component={LoginForm}/>
<Route path="oauth" component={Knapp}/>
</Route>
</Router>, document.getElementById("container") );