Generated route param types should include param matchers guard checks #8137
Labels
contributions-welcome
We're not going to implement this ourselves, but we'll consider contributions
feature / enhancement
New feature or request
types / typescript
Milestone
Describe the problem
Typed route param types do not match ones provided from
params/*
match functions.Consider following setup
Match function is strictly typed using type guard, so typescript knows that function only returns true when param is a fruit.
Now trying to access it inside page using it gives you incorrect type
Describe the proposed solution
Generated route
$types.d.ts
should take into accountmatch
function guard checks, so instead of generated output ofit should be
if using guard types it could even exclude undefined from final type since it would never match it too.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: