diff --git a/docs/start/framework/solid/build-from-scratch.md b/docs/start/framework/solid/build-from-scratch.md index 198926133ac..1b89e63d723 100644 --- a/docs/start/framework/solid/build-from-scratch.md +++ b/docs/start/framework/solid/build-from-scratch.md @@ -154,13 +154,14 @@ Finally, we need to create the root of our application. This is the entry point ```tsx // src/routes/__root.tsx /// -import type * as Solid from 'solid-js' +import * as Solid from 'solid-js' import { Outlet, createRootRoute, HeadContent, Scripts, } from '@tanstack/solid-router' +import { HydrationScript } from 'solid-js/web' export const Route = createRootRoute({ head: () => ({ @@ -190,11 +191,16 @@ function RootComponent() { function RootDocument({ children }: Readonly<{ children: Solid.JSX.Element }>) { return ( - <> - - {children} - - + + + + + + + {children} + + + ) } ``` diff --git a/docs/start/framework/solid/guide/client-entry-point.md b/docs/start/framework/solid/guide/client-entry-point.md index e35589ebc20..b73408e8e46 100644 --- a/docs/start/framework/solid/guide/client-entry-point.md +++ b/docs/start/framework/solid/guide/client-entry-point.md @@ -13,9 +13,11 @@ Getting our html to the client is only half the battle. Once there, we need to h ```tsx // src/client.tsx import { hydrate } from 'solid-js/web' -import { StartClient } from '@tanstack/solid-start/client' +import { StartClient, hydrateStart } from '@tanstack/solid-start/client' -hydrate(() => , document.body) +hydrateStart().then((router) => { + hydrate(() => , document) +}) ``` This enables us to kick off client-side routing once the user's initial server request has fulfilled.