Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Commit 7de057e

Browse files
refactor: use new app setup (#257)
1 parent 4b62aea commit 7de057e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

packages/app/src/App.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ import { apis } from './apis';
2121
import { Root } from './components/Root';
2222

2323
import { createApp } from '@backstage/app-defaults';
24-
import { FlatRoutes } from '@backstage/core-app-api';
24+
import { AppRouter, FlatRoutes } from '@backstage/core-app-api';
2525
import { AlertDisplay, OAuthRequestDialog } from '@backstage/core-components';
2626
import { CadPage } from '@kpt/backstage-plugin-cad';
2727

2828
const app = createApp({
2929
apis,
3030
});
3131

32-
const AppProvider = app.getProvider();
33-
const AppRouter = app.getRouter();
34-
3532
const routes = (
3633
<FlatRoutes>
3734
<Navigate key="/" to="config-as-data" />
@@ -40,14 +37,12 @@ const routes = (
4037
</FlatRoutes>
4138
);
4239

43-
const App = () => (
44-
<AppProvider>
40+
export default app.createRoot(
41+
<>
4542
<AlertDisplay />
4643
<OAuthRequestDialog />
4744
<AppRouter>
4845
<Root>{routes}</Root>
4946
</AppRouter>
50-
</AppProvider>
47+
</>,
5148
);
52-
53-
export default App;

0 commit comments

Comments
 (0)