I have a React - Redux - React Router v4 application in which the URL looks something like this:
www.mysite.com/:accountName/brands/:brandId/something
www.mysite.com/:accountName/brands/:brandId/somethingElse
An actual example would be:
www.mysite.com/sears/brands/levis/jobs
In my global navigation menu, I have a Brand Select dropdown menu where I can switch the selected brand via. brandId. The idea is to keep the rest of the URL untouched and just change the brandId param.
So when the new brand URL is clicked, the updated URL should be: www.mysite.com/sears/brands/wrangler/jobs
One approach I thought of was to use a RegEx to replace the path, but that seems like an imperative approach.
Is there a native way in React Router v4 to achieve this?