From a448fea69168e371c974d05ff17b6ebe69a6b674 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 25 Mar 2022 16:44:08 +0100 Subject: [PATCH] core-app-api: route collection react-router stable compatibility Signed-off-by: Patrik Oldsberg --- .changeset/good-avocados-grow.md | 5 +++++ packages/core-app-api/src/routing/collectors.test.tsx | 2 +- packages/core-app-api/src/routing/collectors.tsx | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/good-avocados-grow.md diff --git a/.changeset/good-avocados-grow.md b/.changeset/good-avocados-grow.md new file mode 100644 index 0000000000..daf161b399 --- /dev/null +++ b/.changeset/good-avocados-grow.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': minor +--- + +Updated the routing system to be compatible with `react-router` v6 stable. diff --git a/packages/core-app-api/src/routing/collectors.test.tsx b/packages/core-app-api/src/routing/collectors.test.tsx index 1c5bc8c639..bb67966fbd 100644 --- a/packages/core-app-api/src/routing/collectors.test.tsx +++ b/packages/core-app-api/src/routing/collectors.test.tsx @@ -109,7 +109,7 @@ function routeObj( routeRefs: new Set(refs), children: [ { - path: '/*', + path: '*', caseSensitive: false, element: 'match-all', routeRefs: new Set(), diff --git a/packages/core-app-api/src/routing/collectors.tsx b/packages/core-app-api/src/routing/collectors.tsx index fcd954201a..13220d769a 100644 --- a/packages/core-app-api/src/routing/collectors.tsx +++ b/packages/core-app-api/src/routing/collectors.tsx @@ -30,7 +30,7 @@ import { FeatureFlagged, FeatureFlaggedProps } from './FeatureFlagged'; // mount points that are as deep in the routing tree as possible. export const MATCH_ALL_ROUTE: BackstageRouteObject = { caseSensitive: false, - path: '/*', + path: '*', element: 'match-all', // These elements aren't used, so we add in a bit of debug information routeRefs: new Set(), };