If you need to reload the components when route has changed there is an elegant solution to do it with help of key:
<Switch> <Route path="/user/:id" component={(props) => (<User key={"user" + props.match.params.id} {...props} />)} /> </Switch>
Ivan Ignatiev – Cloud Consultant and Architect
#Development #DevSecOps #Infrastructure #Cloud #Architecture #FullStack
If you need to reload the components when route has changed there is an elegant solution to do it with help of key:
<Switch> <Route path="/user/:id" component={(props) => (<User key={"user" + props.match.params.id} {...props} />)} /> </Switch>