Skip to content

docs: warn about <Outlet /> requirement in layout route files - #8232

Open
dikshit-n wants to merge 2 commits into
TanStack:mainfrom
dikshit-n:fix/layout-route-outlet-warning
Open

docs: warn about <Outlet /> requirement in layout route files#8232
dikshit-n wants to merge 2 commits into
TanStack:mainfrom
dikshit-n:fix/layout-route-outlet-warning

Conversation

@dikshit-n

@dikshit-n dikshit-n commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Add a documentation warning to the TanStack Start routing guide explaining that layout route files (e.g. posts.tsx) need an <Outlet /> to render child routes.

Problem

Closes #5351

New users following the getting started guide can get stuck when creating nested routes. The development server auto-fills layout route files with a basic component, but without an <Outlet />, child routes silently fail to render. The user sees no error — the dynamic URL just appears to do nothing. This creates a poor first experience.

Solution

Added a [!WARNING] callout directly in the "Creating File Routes" section of docs/start/framework/react/guide/routing.md. The callout:

  • Explains that layout routes need <Outlet /> to render children
  • Shows a concrete code example with the correct pattern
  • Explicitly calls out the symptom (navigating to /posts/123 appears to do nothing)

Changes Made

  • docs/start/framework/react/guide/routing.md: Added [!WARNING] callout after the file-routes table, before the "Defining Routes" section

Testing

  • Documentation-only change — verified the file parses correctly
  • Ran prettier --check on the modified file (documentation format is consistent)

Checklist

  • Documentation updated
  • No unrelated changes
  • No test changes required (this is a docs-only change)

Summary by CodeRabbit

  • Documentation
    • Added guidance explaining that layout routes require an <Outlet /> to render child routes.
    • Included an example demonstrating the behavior when <Outlet /> is omitted.

Fixes TanStack#5351

Add a [!WARNING] callout to the 'Creating File Routes' section
in docs/start/framework/react/guide/routing.md explaining that
layout route files (e.g. posts.tsx) need an <Outlet /> to render
child routes. Without it, child routes like /posts/123 silently
fail to render, which is a common first-time-user gotcha when
following the getting started guide.
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: bf65c363-5627-4594-9f69-3f277713a8c0

📥 Commits

Reviewing files that changed from the base of the PR and between edf0e16 and d146bc4.

📒 Files selected for processing (1)
  • docs/start/framework/react/guide/routing.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The routing guide now explains that layout routes must render <Outlet /> for child routes to appear. It includes a posts.tsx example and documents the behavior when <Outlet /> is omitted.

Changes

Routing documentation

Layer / File(s) Summary
Document layout route rendering
docs/start/framework/react/guide/routing.md
Adds an import and rendering example for <Outlet /> in a layout route. Documents that child routes do not appear when <Outlet /> is omitted.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to b016a

The routing guide now documents the required Outlet usage for layout routes without introducing an outstanding merge risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main documentation change: warning that layout routes require .
Description check ✅ Passed The description explains the problem, solution, affected file, testing, and documentation-only scope. It does not reproduce the repository template headings or release-impact checklist, but the requir…
Linked Issues check ✅ Passed The PR satisfies issue #5351 by documenting that layout route files require and by explaining the symptom that child routes such as /posts/123 appear not to render.
Out of Scope Changes check ✅ Passed The changes are limited to the routing guide and directly support the linked issue. No unrelated code or documentation changes are described.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Description check

Explanation

The description explains the problem, solution, affected file, testing, and documentation-only scope. It does not reproduce the repository template headings or release-impact checklist, but the required context is mostly complete.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation Getting Started Flow - auto file gen can get users stuck

1 participant