Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d6ec9b

Browse files
committed
fix: Don't hydrate html
1 parent 9f3e774 commit 4d6ec9b

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

app/client.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ import './utils/sentry'
55

66
const router = createRouter()
77

8-
hydrateRoot(document, <StartClient router={router} />)
8+
// hydrateRoot(document, <StartClient router={router} />)
9+
hydrateRoot(document.getElementById('root')!, <StartClient router={router} />)

app/routes/__root.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ import appCss from '~/styles/app.css?url'
1313
import carbonStyles from '~/styles/carbon.css?url'
1414
import { seo } from '~/utils/seo'
1515
import ogImage from '~/images/og.png'
16-
import { RouterManagedTag, Scripts, Meta } from '@tanstack/start'
16+
import {
17+
RouterManagedTag,
18+
Scripts,
19+
Meta,
20+
Html,
21+
Head,
22+
Body,
23+
} from '@tanstack/start'
1724
import { TanStackRouterDevtools } from '@tanstack/router-devtools'
1825
import { NotFound } from '~/components/NotFound'
1926
import { CgSpinner } from 'react-icons/cg'
@@ -142,14 +149,14 @@ function RootDocument({ children }: { children: React.ReactNode }) {
142149
const showDevtools = showLoading && isRouterPage
143150

144151
return (
145-
<html lang="en">
146-
<head>
152+
<Html lang="en">
153+
<Head>
147154
<Meta />
148155
{matches.find((d) => d.staticData?.baseParent) ? (
149156
<base target="_parent" />
150157
) : null}
151-
</head>
152-
<body>
158+
</Head>
159+
<Body>
153160
<SpeedInsights />
154161
<Analytics />
155162
<React.Suspense fallback={null}>{children}</React.Suspense>
@@ -179,7 +186,7 @@ function RootDocument({ children }: { children: React.ReactNode }) {
179186
) : null}
180187
<ScrollRestoration />
181188
<Scripts />
182-
</body>
183-
</html>
189+
</Body>
190+
</Html>
184191
)
185192
}

0 commit comments

Comments
 (0)