I have my roots defined like following:
<Route path="/" onEnter={this.verifyLang}>
<Route path="/:lang" onEnter={this.verifyLang}>
<IndexRoute component={this.getIndexRoute()} />
<Route path="auth">
<Route path="confirm-password" component={this.getIndexRoute()} />
<Route path="confirm-code/code=:code&email=:email" component={this.getIndexRoute()} />
<Route path="confirm_email" component={this.getIndexRoute()} />
</Route>
<Route path="landing" component={Landing} />
<Route path="impress" component={Impress} />
</Route>
</Route>
The function this.getIndexRoute()
gives me Launch component. Now inside Launch component I have a method:
componentWillReceiveProps(nextProps){
browserHistory.push('landing');
}
I am expecting to redirect to Landing component but nothing happens. Why it is so?