React-router: changing query string does not re-mount the component React-router: changing query string does not re-mount the component reactjs reactjs

React-router: changing query string does not re-mount the component


React router suggests this exact thing from their docs: Component Lifecycle

If you look closer to the bottom there is an example of data fetching for the component.

I personally really like fetching data this way. It keeps data fetching tied to the React lifecycle so you can always be sure of when the data fetching happens.