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.

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