React does not reload component when route parameters have changed

If you need to reload the components when route has changed there is an elegant solution to do it with help of key:

   <Route path="/user/:id" component={(props) => (<User key={"user" +} {...props} />)} />

Leave a Reply

Your email address will not be published. Required fields are marked *