fix: resolve MatchRoute return types for pathless (layout) routes - #7571
fix: resolve MatchRoute return types for pathless (layout) routes#7571EduardF1 wants to merge 3 commits into
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)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe PR broadens ChangesMatchRouteFn Type Signature Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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
Fixes #6011
Currently,
router.matchRoutereturns a type offalsewhen matching against paths contained within pathless (layout) routes (e.g._pathless/nested/$id). The runtime behavior is correct, but the genericTResolvedresolution fails to extract the underlying string type when passing throughNoInfervia the Layout masking.This patch adds a string union extraction step on
TResolved, ensuring the generic constraint successfully unwraps the pathless definition and provides proper TS intellisense (ResolveParams) without evaluating toneverorfalse.Testing
Verified TS compiler locally.
Summary by CodeRabbit