React-router: router.history.push() changes URL but not the actual page

Created on 23 Mar 2017  路  1Comment  路  Source: ReactTraining/react-router

Version

4.0.0

when wrapping a <Link> and adding a onClick prop,

<Link
  to={to}
  onClick={this.beforeNavigate}
>
 {this.props.children}
</Link>

in this.beforeNavigate, this.context.router.history.push() exists, but when I call it with a custom path, the url changes but the page view doesn't.

The reason I created this issue is because this behaviour only happens when I upgraded form react-router-dom4.0.0-beta.6 to react-router-dom4.0.0. When using the this.router.push in the beta version, everything works. The app is wrapped in a <BrowserRouter> component

Curious to see if this may be a bug.

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

misterwilliam picture misterwilliam  路  3Comments

ryansobol picture ryansobol  路  3Comments

Waquo picture Waquo  路  3Comments

nicolashery picture nicolashery  路  3Comments

Radivarig picture Radivarig  路  3Comments