background:
some people say:
"withRouter can wrap any custom component, passing in three objects of react-router "s history,location,match.
there is no need to pass react-router attributes at one level. When you need to use the router
attribute, you can get the routing information you need by adding a layer of withRouter, to the component package.
others say:
if you use react-router-redux, you can get location directly from the router attribute in stateIs
. You don"t need to use withRouter to get routing information anymore
withRouter just to get this.props.location? are there any other examples that you haven"t noticed but withRouter
has played a big role?