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.
17 lines
428 B
JavaScript
17 lines
428 B
JavaScript
import React from 'react';
|
|
import { BrowserRouter as Router } from 'react-router-dom';
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { getBaseName } from './Utilities/path';
|
|
import App from './App';
|
|
import { store } from './store';
|
|
|
|
const ImageBuilder = () => (
|
|
<Provider store={store}>
|
|
<Router basename={getBaseName(window.location.pathname)}>
|
|
<App />
|
|
</Router>
|
|
</Provider>
|
|
);
|
|
|
|
export default ImageBuilder;
|