If all you really want is for the route component to rerender each time the link to its route is clicked then just have those components call theuseLocationhook. Each time the link is clicked a newlocationobject reference is created. The newlocationobject reference is enough to trigger the component using it to be rerendered.
If all you really want is for the route component to rerender each time the link to its route is clicked then just have those components call the
useLocation
hook. Each time the link is clicked a newlocation
object reference is created. The newlocation
object reference is enough to trigger the component using it to be rerendered.Example: