Did you try the browserHistory option ? You will be able also to refresh the page from the browser or specify a url of one of existing routes and land on the right page.
import { Router, Route, browserHistory } from 'react-router';
ReactDOM.render((
<Router history={browserHistory}>
<Route path='/' component={MasterPage}>
<IndexRoute component={LoginPage} />
<Route path='/search' component={SearchPage} />
<Route path='/login' component={LoginPage} />
<Route path='/payment' component={PaymentPage} />
</Route>
</Router>),
document.getElementById('app-container'));
Moreover hashHistory is not for production use considering the react-router github doc.
https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory
Should I use hashHistory?
Hash history works without configuring your server, so if you're just
getting started, go ahead and use it. But, we don't recommend using it
in production, every web app should aspire to use browserHistory
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…