You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have navigation menu with the list of items. User clicks to the navigation item and redirects to the related url
I use my own types for navigation items and would like to reuse the same type validation as in the router library
Current issue: types does not work as expected
import{redirect}from'@tanstack/react-router';redirect({to: 'path/$pathId',params: {pathId: 'id'}})// validtypeMyNavigationItemOptions={navigationOptions: NavigateOptions<RegisteredRouter['routeTree']>// what is the expected type to use there?}constitem: MyNavigationItemOptions={{to: 'path/$pathId',params: {pathId: 'id'}}// error -> expected type : {to: 'path/$pathId'} }
Version: "@tanstack/react-router": "^1.16.5",
Question: which type should I use to keep the same type validation as in redirect function?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My scope:
path/$pathId
Current issue: types does not work as expected
Version: "@tanstack/react-router": "^1.16.5",
Question: which type should I use to keep the same type validation as in redirect function?
Beta Was this translation helpful? Give feedback.
All reactions