Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

26 linesCodeBlameRaw
1import { StrictMode, startTransition } from "react";
2import { hydrateRoot } from "react-dom/client";
3import { HydratedRouter } from "react-router/dom";
4
5// Product analytics, started before the app (lib/analytics.client.ts).
6import "./lib/analytics.client";
7import { installResilientFetch } from "./lib/resilient-fetch";
8
9// The router's reads outlast a moment offline (lib/resilient-fetch.ts).
10installResilientFetch();
11
12startTransition(() => {
13 hydrateRoot(
14 document,
15 <StrictMode>
16 <HydratedRouter />
17 </StrictMode>,
18 {
19 // React recovers from a page the server rendered differently by
20 // rendering it again here; say where, so it can be fixed.
21 onRecoverableError(error, info) {
22 console.error("g1t: recovered from", error, info.componentStack);
23 },
24 },
25 );
26});