browserHistory не работает в React-роутере - PullRequest
0 голосов
/ 03 мая 2018

Я пытался изменить hashHistory на browserHistory в React-router, но у меня возникла проблема с ним. Я заменил hashHistory на browserHistory, но браузер показывает предупреждение:

    Warning: [react-router] Location "/supmev2/index.html_ijt=3k35aa2cad6gsqau4hqdg9gvnp" did not match any routes

My 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>
    )
}
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...