definePage lacks generics: how to redirect to a children using the current page params? #626
Unanswered
darkbasic
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For the detailed view of a certain item (
/items/[id]
) I have a tabbed view (/items/[id]/a
,/items/[id]/b
...).One of the tabs must be the default one, so
/items/[id]
should redirect to it.The easiest solution would be something like:
but I don't like it because it's not type safe.
Another solution would be the following:
Somehow I couldn't find a way to set the correct typings for the current route for
to
inredirect
becausedefinePage
doesn't have a generic (likedefinePage<'/items/[id]'>
). Am I doing something wrong?Beta Was this translation helpful? Give feedback.
All reactions