React-router: match params not being passed down to component wrapped by `withRouter`.

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

_This is an official bug report that was originally part of the discussion on #4630. That issue was not opened to discuss re-rendering issues with withRouter, whereas this is to discuss issues with the match object not being passed down properly._

Version

[email protected]
[email protected]

Test Case

http://codepen.io/indiesquidge/pen/KWgoNX

Steps to reproduce

(See codepen link above)

Expected Behavior

match params should be passed down to components wrapped by withRouter

Actual Behavior

match params not being passed down to components wrapped by withRouter

It seems like this change was explicitly stating that only the closest <Route>'s match would be available when using withRouter, but it doesn't state that a pathless <Route> will (or should) inherit match from its parent in order to get access to, say, match.params. Should it say that?

Most helpful comment

Fixed by 394eb09

>All comments

Fixed by 394eb09

Was this page helpful?
0 / 5 - 0 ratings