Skip to content

docs: fix file extension syntax for prefix/suffix routing examples#7149

Merged
schiller-manuel merged 1 commit intoTanStack:mainfrom
XXMOHAMED012:fix-docs-path-params
Apr 11, 2026
Merged

docs: fix file extension syntax for prefix/suffix routing examples#7149
schiller-manuel merged 1 commit intoTanStack:mainfrom
XXMOHAMED012:fix-docs-path-params

Conversation

@XXMOHAMED012
Copy link
Copy Markdown
Contributor

@XXMOHAMED012 XXMOHAMED012 commented Apr 11, 2026

Description

This PR fixes a syntax error in the file names provided in the documentation for prefix and suffix routing patterns (applicable to both React and Solid docs).

Currently, the documentation examples show file names ending directly with .json and .txt (e.g., user-{$userId}.json). According to TanStack Router's file-based routing conventions, literal dots in the URL path must be escaped using brackets [.], and the file itself must have a valid component extension (like .tsx) to properly export the route component.

Changes Made

Updated the file path examples in the "Combining Prefixes and Suffixes" and "Advanced Optional Parameter Patterns" sections:

  • src/routes/users/user-{$userId}.json ➡️ src/routes/users/user-{$userId}[.]json.tsx
  • src/routes/files/prefix{-$name}.txt ➡️ src/routes/files/prefix{-$name}[.]txt.tsx

Motivation

To prevent confusion for new developers copying the file names directly from the documentation, ensuring the examples strictly follow the [.] escaping convention for literal dots in paths.

Summary by CodeRabbit

  • Documentation
    • Updated code examples in routing guide to reflect current syntax conventions for optional suffixes and patterns.

@github-actions github-actions bot added the documentation Everything documentation related label Apr 11, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8558bcbe-fa77-4cff-beb7-3dbc98bac0e8

📥 Commits

Reviewing files that changed from the base of the PR and between d11977f and cffe606.

📒 Files selected for processing (1)
  • docs/router/guide/path-params.md

📝 Walkthrough

Walkthrough

Documentation update to path-params guide that modifies code example snippet titles to reflect new optional suffix/pattern syntax for route file paths. The underlying route definitions remain unchanged.

Changes

Cohort / File(s) Summary
Documentation Metadata Updates
docs/router/guide/path-params.md
Updated code example snippet titles to show new optional suffix/pattern syntax (e.g., {$userId}[.]json.tsx, prefix{-$name}[.]txt.tsx) while keeping createFileRoute(...) calls unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A documentation hop so light,
Tiny tweaks to make examples right,
Titles shimmer with new syntax glow,
No logic changed, just the path we show! ✨

🚥 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 directly addresses the main change: fixing file extension syntax in routing documentation examples for prefix/suffix patterns.
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

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.

@schiller-manuel schiller-manuel merged commit 9797eac into TanStack:main Apr 11, 2026
2 checks passed
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.

2 participants