Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AppRoot.tsx

19 lines662 Bytes

1import { RouterProvider } from "@tanstack/react-router";
2​
3import { ElectronBrowserHost } from "./browser/ElectronBrowserHost";
4import { AppAtomRegistryProvider } from "./rpc/atomRegistry";
5import type { AppRouter } from "./router";
6​
7/**
8 * Owns renderer-wide providers. The Electron browser host intentionally sits
9 * outside the router so its webviews survive route transitions, but it must
10 * share the same atom registry as routed UI.
11 */
12export function AppRoot({ router }: { readonly router: AppRouter }) {
13 return (
14 <AppAtomRegistryProvider>
15 <RouterProvider router={router} />
16 <ElectronBrowserHost />
17 </AppAtomRegistryProvider>
18 );