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