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
-
I have a suggestion regarding the typing of
useRoute
, specifically concerning themeta
property.Currently,
useRoute
returns RouteLocationNormalizedLoadedTyped, which does not leverage themeta
type defined in theRouteNamedMap
. I believe there could be a more type-safe way to handle themeta
property by incorporating it intoRouteLocationNormalizedLoadedTyped
Here is a proposed enhancement:
By default,
RouteMap[Name]['meta']
would have the type RouteMeta, preserving the current behavior while allowing for themeta
type to be overridden inRouteRecordInfo
Example
Beta Was this translation helpful? Give feedback.
All reactions