Files
OpenHands/src/entry.client.tsx
T
2026-04-30 22:46:04 -07:00

45 lines
1.2 KiB
TypeScript

/* eslint-disable react/react-in-jsx-scope */
/**
* By default, Remix will handle hydrating your app on the client for you.
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨
* For more information, see https://remix.run/file-conventions/entry.client
*/
import { HydratedRouter } from "react-router/dom";
import { startTransition, StrictMode } from "react";
import { hydrateRoot } from "react-dom/client";
import {
AgentServerUIProviders,
DEFAULT_AGENT_SERVER_ANALYTICS,
} from "./components/providers";
import { waitForI18n } from "./i18n";
import { shouldStartMockWorker } from "./mocks/should-start-mock-worker";
async function prepareApp() {
await waitForI18n();
if (shouldStartMockWorker()) {
const { worker } = await import("./mocks/browser");
await worker.start({
onUnhandledRequest: "bypass",
});
}
}
prepareApp().then(() =>
startTransition(() => {
hydrateRoot(
document,
<StrictMode>
<AgentServerUIProviders
analytics={DEFAULT_AGENT_SERVER_ANALYTICS}
withStyleRoot={false}
>
<HydratedRouter />
</AgentServerUIProviders>
</StrictMode>,
);
}),
);