score:3

Accepted answer

from the docs:

when you use component (instead of render or children, below) the router uses react.createelement to create a new react element from the given component. that means if you provide an inline function to the component prop, you would create a new component every render. this results in the existing component unmounting and the new component mounting instead of just updating the existing component. when using an inline function for inline rendering, use the render or the children prop.

instead what you can do is to use render function:

<route
  path={`${this.props.match.path}/player_list`}
  render={props => (
   <playerlist {...props} basepath={this.props.match.path} />
  )}
/>

docs on render


Related Query

More Query from same tag