URL State with React Router 6 and Search Params
robinwieruch.de
robinwieruch.de
Do not directly use library code in your react components, such as react-router (unless your top level route definitions of course).
Let your react components consume data given in their parameters, let them be oblivious to how you got that data. If you have to use a library hook, wrap that hook in your own hook and write a unit test for your custom hook because I promise you, the library hook will break in a version upgrade. I reapeat: the library hook WILL break in a future version upgrade
:)