我试图在React-router中将hashHistory更改为browserHistory,但我遇到了问题。我用browserHistory替换了hashHistory,但浏览器显示警告:
Warning: [react-router] Location "/supmev2/index.html_ijt=3k35aa2cad6gsqau4hqdg9gvnp" did not match any routes
我的App.jsx:
class App extends React.Component{
render(){
return (
<Router history={browserHistory}>
<Route path="/" component={Template}>
<IndexRoute component={HomePage}></IndexRoute>
<Route path="/contact" component={Contact}></Route>
</Route>
</Router>
)
}
}
这是我的模板:{
class Template extends React.Component {
render() {
return (
<div>
{this.props.children}
<Footer></Footer>
</div>
)
}
}