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

AppRoot.tsx

21 lines781 Bytes

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