React Router v2
Even if the question has already been given, I consider it appropriate to publish a solution that worked for me, since it was not covered by any of the solutions given here.
First, I use a router context for my LoginForm component
LoginForm.contextTypes = { router: React.PropTypes.object };
After that, I can access the router object inside my LoginForm component
handleLogin() { this.context.router.push('/anotherroute'); }
PS: working with React-router version 2.6.0
Bruno Henrique Jul 28 '16 at 14:38 2016-07-28 14:38
source share