I am trying to do A SIMPLE using react-router ( version ^1.0.3 ) to redirect to another view and I am just getting tired.
import React from
For the simple answer, you can use Link
component from react-router
, instead of button
. There is ways to change the route in JS, but seems you don't need that here.
Click to login
To do it programmatically in 1.0.x, you do like this, inside your clickHandler function:
this.history.pushState(null, 'login');
Taken from upgrade doc here
You should have this.history
placed on your route handler component by react-router
. If it child component beneath that mentioned in routes
definition, you may need pass that down further