Skip to content

Fixed docs about deferred data loading#6932

Open
segmentationfaulter wants to merge 1 commit intoTanStack:mainfrom
segmentationfaulter:patch-2
Open

Fixed docs about deferred data loading#6932
segmentationfaulter wants to merge 1 commit intoTanStack:mainfrom
segmentationfaulter:patch-2

Conversation

@segmentationfaulter
Copy link

@segmentationfaulter segmentationfaulter commented Mar 16, 2026

The suspense boundary wrapping the Await component was missing, also fallback prop was placed on Await component which should have gone to the Suspense component.

Summary by CodeRabbit

  • Documentation
    • Updated deferred data loading guide to show a new recommended pattern. The documentation now demonstrates using Suspense boundaries to manage loading states in conjunction with the Await component for improved control flow.

@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

⚠️ No Changeset found

Latest commit: 302ece9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the documentation Everything documentation related label Mar 16, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

Documentation update to the deferred data loading guide demonstrating a pattern shift where loading UI is moved from the Await component's fallback prop to an outer Suspense boundary.

Changes

Cohort / File(s) Summary
Documentation Updates
docs/router/guide/deferred-data-loading.md
Updated example pattern to wrap Await in a Suspense boundary for managing loading state instead of using Await's fallback prop directly.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A Suspense boundary now guides the way,
Wrapping Await in the light of day,
No fallback prop to clutter the view,
Just cleaner patterns, shiny and new!
CodeRabbit's eager assistant 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fixed docs about deferred data loading' directly and clearly describes the main change—correcting documentation for the deferred data loading pattern by adding a Suspense boundary and moving the fallback prop.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/router/guide/deferred-data-loading.md (1)

42-42: ⚠️ Potential issue | 🟡 Minor

Add missing Suspense import.

The code example on line 55 uses the Suspense component, but it's not imported. Users will get a reference error if they copy this example.

📦 Proposed fix to add the missing import
-import { createFileRoute, Await } from '@tanstack/react-router'
+import { createFileRoute, Await } from '@tanstack/react-router'
+import { Suspense } from 'react'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/router/guide/deferred-data-loading.md` at line 42, The example uses the
Suspense component but it's not imported; add an import for Suspense from
'react' (e.g., import { Suspense } from 'react') so the Suspense symbol used in
the example is defined—update the top imports alongside the existing
createFileRoute / Await usage to include this new import.
🧹 Nitpick comments (1)
docs/router/guide/deferred-data-loading.md (1)

55-61: Clarify whether to use Await's fallback prop or an explicit Suspense wrapper.

The documented code example uses an explicit Suspense boundary without using the Await component's fallback prop. However, the Await component implementation shows the fallback prop is still supported and optional. Both patterns work—when fallback is provided, Await internally wraps itself in Suspense.

Add a note explaining which pattern is recommended, or document both approaches, so users understand when to use each pattern.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/router/guide/deferred-data-loading.md` around lines 55 - 61, Add a short
explanatory note near the example clarifying that Await supports an optional
fallback prop (Await fallback={...}) and will internally wrap itself with
Suspense when provided, while the shown pattern uses an explicit Suspense
wrapper; recommend using Await's fallback for simple single-promise cases (like
Await with deferredSlowData) and prefer an explicit Suspense boundary when you
need to group multiple Await instances or control a larger UI region. Include
the symbols Suspense, Await, fallback, and deferredSlowData in the text so
readers can find the relevant example.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/router/guide/deferred-data-loading.md`:
- Line 42: The example uses the Suspense component but it's not imported; add an
import for Suspense from 'react' (e.g., import { Suspense } from 'react') so the
Suspense symbol used in the example is defined—update the top imports alongside
the existing createFileRoute / Await usage to include this new import.

---

Nitpick comments:
In `@docs/router/guide/deferred-data-loading.md`:
- Around line 55-61: Add a short explanatory note near the example clarifying
that Await supports an optional fallback prop (Await fallback={...}) and will
internally wrap itself with Suspense when provided, while the shown pattern uses
an explicit Suspense wrapper; recommend using Await's fallback for simple
single-promise cases (like Await with deferredSlowData) and prefer an explicit
Suspense boundary when you need to group multiple Await instances or control a
larger UI region. Include the symbols Suspense, Await, fallback, and
deferredSlowData in the text so readers can find the relevant example.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e0e7dada-6274-437f-a14f-d02ffd0cb64f

📥 Commits

Reviewing files that changed from the base of the PR and between 268bff2 and 302ece9.

📒 Files selected for processing (1)
  • docs/router/guide/deferred-data-loading.md

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

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant