Explicitly disable v7 future flags to suppress warnings
Rather than removing the future prop, set v7_relativeSplatPath and v7_startTransition to false so react-router stops logging deprecation warnings. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -53,4 +53,4 @@
|
||||
'@backstage/plugin-org': patch
|
||||
---
|
||||
|
||||
Updated `react-router-dom` peer dependency to `^6.30.2`.
|
||||
Updated `react-router-dom` peer dependency to `^6.30.2` and explicitly disabled v7 future flags to suppress deprecation warnings.
|
||||
|
||||
@@ -208,7 +208,13 @@ export function renderInTestApp<const TApiPairs extends any[] = any[]>(
|
||||
RouterBlueprint.make({
|
||||
params: {
|
||||
component: ({ children }) => (
|
||||
<MemoryRouter initialEntries={options?.initialRouteEntries}>
|
||||
<MemoryRouter
|
||||
initialEntries={options?.initialRouteEntries}
|
||||
future={{
|
||||
v7_relativeSplatPath: false,
|
||||
v7_startTransition: false,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</MemoryRouter>
|
||||
),
|
||||
|
||||
@@ -150,7 +150,13 @@ export function renderTestApp<const TApiPairs extends any[] = any[]>(
|
||||
RouterBlueprint.make({
|
||||
params: {
|
||||
component: ({ children }) => (
|
||||
<MemoryRouter initialEntries={options?.initialRouteEntries}>
|
||||
<MemoryRouter
|
||||
initialEntries={options?.initialRouteEntries}
|
||||
future={{
|
||||
v7_relativeSplatPath: false,
|
||||
v7_startTransition: false,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</MemoryRouter>
|
||||
),
|
||||
|
||||
@@ -198,7 +198,17 @@ export interface AppRouterProps {
|
||||
function DefaultRouter(props: PropsWithChildren<{}>) {
|
||||
const configApi = useApi(configApiRef);
|
||||
const basePath = getBasePath(configApi);
|
||||
return <BrowserRouter basename={basePath}>{props.children}</BrowserRouter>;
|
||||
return (
|
||||
<BrowserRouter
|
||||
basename={basePath}
|
||||
future={{
|
||||
v7_relativeSplatPath: false,
|
||||
v7_startTransition: false,
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user