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
@Tanstack/react-router provides a vite plugin that provides type-safe routes, but I hate it. I have a menu array, import.meta.glob matches the corresponding route file (the route file path has a mapping relationship with the menu path), and then converts the menu array to routes. My code is as follows:
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.
-
@Tanstack/react-router provides a vite plugin that provides type-safe routes, but I hate it. I have a menu array, import.meta.glob matches the corresponding route file (the route file path has a mapping relationship with the menu path), and then converts the menu array to routes. My code is as follows:
In this case, I can't get a type-safe route. Is there a more reasonable way to write it?
Beta Was this translation helpful? Give feedback.
All reactions