fix: resolve MatchRoute return types for pathless (layout) routes#7571
fix: resolve MatchRoute return types for pathless (layout) routes#7571EduardF1 wants to merge 1 commit 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)
📝 WalkthroughWalkthroughThe PR refines the ChangesMatchRouteFn Type Signature Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
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