I'm looking for a way to reliably update a dynamic param in a URL with React Router 5.
My webpage has a global select component that allows to switch between different organizations and the URL can have multiple IDs in it.
The URL may look something like this https://www.baseurl.com/organization/:orgId/site/:siteId/user/:userId
So I need to change the :orgId
param when the select value changes. Does React Router 5
provide a good way to do that (useLocation
and useParams
doesn't seem to have an API for that) or should I manipulate the URL string manually in such case?