Enhancing useRoute to use RouteRecordInfo meta type from RouteNamedMap #389
Closed
joris-gallot
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
This is planned! Ideally we could even extract the type from definePage otherwise it could be passed as type parameter to a a generic definePage |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I have a suggestion regarding the typing of
useRoute, specifically concerning themetaproperty.Currently,
useRoutereturns RouteLocationNormalizedLoadedTyped, which does not leverage themetatype defined in theRouteNamedMap. I believe there could be a more type-safe way to handle themetaproperty by incorporating it intoRouteLocationNormalizedLoadedTypedHere is a proposed enhancement:
By default,
RouteMap[Name]['meta']would have the type RouteMeta, preserving the current behavior while allowing for themetatype to be overridden inRouteRecordInfoExample
Beta Was this translation helpful? Give feedback.
All reactions