Can you strongly type or validate path parameters? #1666
Answered
by
TkDodo
dgraham-nectivio
asked this question in
Q&A
|
I have a route with a path parameter that is union of string literals. Is there a way to strongly type that $mailbox is MailboxName, so that TS flags Currently I have a check in my |
Answered by
TkDodo
May 24, 2024
Replies: 3 comments 5 replies
|
I think |
3 replies
Answer selected by
dgraham-nectivio
|
🚨 parseParams have been deprecated in favour of params.parse |
2 replies
|
Minimal example for params.parse: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think
parseParamsshould do this, no?https://tanstack.com/router/latest/docs/framework/react/api/router/RouteOptionsType#parseparams-method