Can you strongly type or validate path parameters? #1666
-
|
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 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
I think |
Beta Was this translation helpful? Give feedback.
-
|
🚨 parseParams have been deprecated in favour of params.parse |
Beta Was this translation helpful? Give feedback.
-
|
Minimal example for params.parse: |
Beta Was this translation helpful? Give feedback.
I think
parseParamsshould do this, no?https://tanstack.com/router/latest/docs/framework/react/api/router/RouteOptionsType#parseparams-method