The insights platform is moving to react router v6, meaning router
contexts can no longer be nested. As a result all applications will end
up sharing the same `BrowserRouter`.
Switch to using the release (`/` or `/beta/`) as a basename for the
BrowserRouter, and offload the full path (`/insights/$appname`) to the
individual routes. This makes it easier to drop the BrowserRouter in
image builder for the platform one in future.
This also mitigates the issue where clicking the image-builder nav link
would redirect you to `image-builder/image-builder` if image-builder was
already opened. And `/` didn't catch that path.
React router is moving away from redirects in favor of server side
redirecting since redirects are confusing because the initial "invalid"
route will still return a 200 status and redirecting unnecessarily
wastes resources. Instead of server routing we can also place our
Redirect inside of a Route as an element. Also, instead of using a
Redirect we use a Navigate. This is due to changes in how React Router
handles the history.
In React Router v6 the Route paramater 'exact' is replaced by using a
trailing * to indicate the path matches deeply. Also, elements are now
preferred over components. React, itself, has also been making this
switch. Using elements is simpler than components and integrates
better with hooks.