docs: change hydration target to document.body in custom client.tsx for Solid #5091
main fromrefs/pull/5091/head·merged by brenelz(GitHub profile, opens in a new tab) Fixes #5085
Summary by CodeRabbit#
- Documentation
- Updated the Solid framework “Learn the Basics” guide to correct the client hydration example, targeting the appropriate DOM root.
- Clarifies which element to hydrate, aligning the snippet with current best practices and reducing confusion for readers.
- Improves copy‑paste reliability of the example for newcomers following the setup steps.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsdocumentation
View your CI Pipeline Execution ↗ for commit 754805b73537274befbb96b9882d20ce3b4f2901
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded <1s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 3s View ↗
☁️ Nx Cloud last updated this comment at
2025-09-05 08:57:04UTCMore templates
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-static
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-rsc
- tanstack-start-example-basic-static
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5091@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5091@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5091@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5091@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5091@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5091@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5091@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5091@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5091@tanstack/react-start-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-plugin@5091@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5091@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5091@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5091@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5091@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5091@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5091@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5091@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5091@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5091@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5091@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5091@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5091@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5091@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5091@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5091@tanstack/solid-start-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-plugin@5091@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5091@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5091@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5091@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5091@tanstack/start-server-functions-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-client@5091@tanstack/start-server-functions-fetcher
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-fetcher@5091@tanstack/start-server-functions-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-server@5091@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5091@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5091@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5091@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5091commit:
754805bActionable comments posted: 0
🧹 Nitpick comments (2)
docs/start/framework/solid/learn-the-basics.md (2)
88-88: Correct hydration root; fixes client navigation breakageHydrating
document.bodymatches the server-rendered root and prevents full-document mismatch that can push navigations to the server. Looks good to me.Consider adding a brief callout below the snippet explaining that hydrating
documentcan break client navigation when using a customclient.tsx.hydrate(() => <StartClient router={router} />, document.body)- +> [!IMPORTANT]
+> Hydrate to
document.body. Usingdocumentcan cause a full-document hydration mismatch with a customclient.tsx, resulting in broken client-side navigation.
--- `100-129`: **Render HeadContent and Scripts in the root example (docs consistency)** The snippet imports `HeadContent` and `Scripts` but doesn’t render them, while the text later calls out `Scripts`. Suggest updating the example so it matches the guidance. If Start’s default handlers already inject these for you, either clarify that or remove the imports. ```diff function RootComponent() { - return <Outlet /> + return ( + <> + <HeadContent /> + <Outlet /> + <Scripts /> + </> + ) }📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📥 Commits
Reviewing files that changed from the base of the PR and between 741821b2d2483c0cbf9363333d5b468e6e9ad08e and 754805b73537274befbb96b9882d20ce3b4f2901.
📒 Files selected for processing (1)
docs/start/framework/solid/learn-the-basics.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Preview
- +> [!IMPORTANT]
+> Hydrate to
brenelz(GitHub profile, opens in a new tab) approved these changes
brenelz(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Walkthrough#
Updated a documentation snippet in docs/start/framework/solid/learn-the-basics.md, changing the hydration target from document to document.body in the client hydration example. No code or public API changes.
Changes#
docs/start/framework/solid/learn-the-basics.mddocumenttodocument.body. No other edits.Estimated code review effort#
🎯 1 (Trivial) | ⏱️ ~2 minutes
Assessment against linked issues#
Assessment against linked issues: Out-of-scope changes#
documenttodocument.body(docs/start/framework/solid/learn-the-basics.md)Poem#
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
🪧 Tips
Chat#
There are 3 ways to chat with CodeRabbit:
I pushed a fix in commit <commit_id>, please review it.Open a follow-up GitHub issue for this discussion.@coderabbitaiin a new review comment at the desired location with your query.@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.Support#
Need help? Create a ticket on our support page for assistance with any issues or questions.
CodeRabbit Commands (Invoked using PR/Issue comments)#
Type
@coderabbitai helpto get the list of available commands.Other keywords and placeholders#
@coderabbitai ignoreor@coderabbit ignoreanywhere in the PR description to prevent this PR from being reviewed.@coderabbitai summaryto generate the high-level summary at a specific location in the PR description.@coderabbitaianywhere in the PR title to generate the title automatically.CodeRabbit Configuration File (
.coderabbit.yaml)#.coderabbit.yamlfile to the root of your repository.# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.jsonStatus, Documentation and Community#