Can anyone please tell me how I can go back to the previous page rather than a specific route?
When using this code:
var BackButton = React.createCla
I think you just need to enable BrowserHistory on your router by intializing it like that : .
Before that, you should require BrowserHistory from 'react-router/lib/BrowserHistory'
I hope that helps !
UPDATE : example in ES6
const BrowserHistory = require('react-router/lib/BrowserHistory').default;
const App = React.createClass({
render: () => {
return (
);
}
});
React.render((
), document.body);