2017-08-06 86 views
0

我使用react-router-dom import { BrowserRouter as Router, Route } from 'react-router-dom'; <Provider store={store}> <Router> <App> <Route path="/" exact component={Home} /> <Route path="/application" component={Application} /> </App> </Router> </Provider>, document.getElementById('root') ); 重定向不與版本反應路由器-DOM更新歷史4

我使用<Redirect />重定向,但只有當一種形式是在有效的狀態:

</div> {submitSucceeded && <Redirect to={nextLink} />}

但是,當我去到下一個鏈接,並點擊返回到網站的路線,即歷史沒有更新。

回答

0

答案是使用withRouter,這裏是一個解釋它的link