Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: codex <[email protected]>
20 lines
662 B
TypeScript
20 lines
662 B
TypeScript
import { RouterProvider } from "@tanstack/react-router";
|
|
|
|
import { ElectronBrowserHost } from "./browser/ElectronBrowserHost";
|
|
import { AppAtomRegistryProvider } from "./rpc/atomRegistry";
|
|
import type { AppRouter } from "./router";
|
|
|
|
/**
|
|
* Owns renderer-wide providers. The Electron browser host intentionally sits
|
|
* outside the router so its webviews survive route transitions, but it must
|
|
* share the same atom registry as routed UI.
|
|
*/
|
|
export function AppRoot({ router }: { readonly router: AppRouter }) {
|
|
return (
|
|
<AppAtomRegistryProvider>
|
|
<RouterProvider router={router} />
|
|
<ElectronBrowserHost />
|
|
</AppAtomRegistryProvider>
|
|
);
|
|
}
|