I want to pass some props to component on IndexRoute. Below is my code snippet:
render(root: Element) {
const { store, params } = this as any;
ReactDOM.render(
<Provider {...{ store }} >
<Router history={browserHistory}>
<Route path={window.location.pathname} component={App}>
<IndexRoute component={Step1} />
<Route path="step1" component={() => (<Step1 params={params} />)} />
<Route path="step1" component={() => (<Step2 params={params} />)} />
</Route>
</Router>
</Provider>
, root);
}
//App Component
import * as React from 'react';
export var App: any = ({children}) => (
<div>
<div>{children}</div>
</div>
)
On initial load I am able to load step1 as children but I want to pass some props from routing section to component.
How can I get this?
Please guide me.
Thanks, Vijay