debian-image-builder-frontend/src/AppEntry.js
Sanne Raymaekers 03421acc74 src/Router: use release as a basename in BrowserRouter
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.
2022-10-17 15:53:21 +02:00

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;