docs: fix file extension syntax for prefix/suffix routing examples#7149
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughDocumentation 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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
.jsonand.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.tsxsrc/routes/files/prefix{-$name}.txt➡️src/routes/files/prefix{-$name}[.]txt.tsxMotivation
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