Skip to content
Source
Sign inSign up
TanStack/router

docs: change hydration target to document.body in custom client.tsx for Solid #5091

Mergedjakst(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5091/headmerged 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. 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

      Cohort / File(s)Summary
      Docs: Solid basics hydration snippet
      docs/start/framework/solid/learn-the-basics.md
      In the hydrate example, replaced the root argument from document to document.body. No other edits.

      Estimated code review effort

      🎯 1 (Trivial) | ⏱️ ~2 minutes

      Assessment against linked issues

      ObjectiveAddressedExplanation
      Ensure client navigation works with a custom client.tsx [#5085]❌Only a docs snippet was changed; no logic or package changes affecting hydration or routing.

      Assessment against linked issues: Out-of-scope changes

      Code ChangeExplanation
      Update hydration target in docs snippet from document to document.body (docs/start/framework/solid/learn-the-basics.md)Documentation edit not explicitly requested by #5085 and does not modify runtime behavior or fix the reported bug.

      Poem

      A nibble of docs, a hop to the root, From document to body—more precise, more astute. I twitch my whiskers, reviews done in a flash, Leaves rustle softly as diffs lightly clash. Hippity-hop, the guide is bright— Hydrate just right, by moonlit night.

      ✨ Finishing Touches
      🧪 Generate unit tests
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      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:

      • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
        • I pushed a fix in commit <commit_id>, please review it.
        • Open a follow-up GitHub issue for this discussion.
      • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
      • PR comments: Tag @coderabbitai in 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 help to get the list of available commands.

      Other keywords and placeholders

      • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
      • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
      • Add @coderabbitai anywhere in the PR title to generate the title automatically.

      CodeRabbit Configuration File (.coderabbit.yaml)

      • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
      • Please see the configuration documentation for more information.
      • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

      Status, Documentation and Community

      • Visit our Status Page to check the current availability of CodeRabbit.
      • Visit our Documentation for detailed information on how to use CodeRabbit.
      • Join our Discord Community to get help, request features, and share feedback.
      • Follow us on X/Twitter for updates and announcements.
    2. View your CI Pipeline Execution ↗ for commit 754805b73537274befbb96b9882d20ce3b4f2901

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded<1sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded3sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-09-05 08:57:04 UTC

    3. More templates

      @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@5091

      commit: 754805b

    4. Actionable comments posted: 0

      🧹 Nitpick comments (2)
      docs/start/framework/solid/learn-the-basics.md (2)

      88-88: Correct hydration root; fixes client navigation breakage

      Hydrating document.body matches 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 document can break client navigation when using a custom client.tsx.

        hydrate(() => <StartClient router={router} />, document.body)
      • +> [!IMPORTANT] +> Hydrate to document.body. Using document can cause a full-document hydration mismatch with a custom client.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
    5. brenelz(GitHub profile, opens in a new tab) approved these changes

Sign in to join this conversation.