Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions docs/start/framework/solid/build-from-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ Finally, we need to create the root of our application. This is the entry point
```tsx
// src/routes/__root.tsx
/// <reference types="vite/client" />
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: () => ({
Expand Down Expand Up @@ -190,11 +191,16 @@ function RootComponent() {

function RootDocument({ children }: Readonly<{ children: Solid.JSX.Element }>) {
return (
<>
<HeadContent />
{children}
<Scripts />
</>
<html>
<head>
<HydrationScript />
</head>
<body>
<HeadContent />
<Solid.Suspense>{children}</Solid.Suspense>
<Scripts />
</body>
</html>
)
}
```
Expand Down
6 changes: 4 additions & 2 deletions docs/start/framework/solid/guide/client-entry-point.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => <StartClient />, document.body)
hydrateStart().then((router) => {
hydrate(() => <StartClient router={router} />, document)
})
```

This enables us to kick off client-side routing once the user's initial server request has fulfilled.
Expand Down
Loading