Skip to content

Support overriden route names (through definePageMeta) #81

@ChronicStone

Description

@ChronicStone

It looks like the generated types definition does not take into account overriding of route name using definePageMeta. Here's an actual example :

// DEFAULT PAGE NAME SHOULD BE "testCenter-candidates-candidateId" HERE

definePageMeta({
  name: "testCenter-candidates-profile",
});

navigateTo({ name: "testCenter-candidates-candidateId", params: { candidateId: "hjzez" } });
// VALID NAME, even though the name has been overridden

navigateTo({ name: "testCenter-candidates-profile", params: { candidateId: "hjzez" } });
/*  No overload matches this call.
  Overload 1 of 2, '(to: TypedRouteLocationRawFromName<RoutesNamesList, string>, options?: NavigateToOptions | undefined): Promise<...>', gave the following error.
  Overload 2 of 2, '(to: string, options?: NavigateToOptions | undefined): Promise<void | NavigationFailure | TypedRouteFromName<never>>', gave the following error.ts(2769)

*/

Is this an actual limitation, or something that can be addressed ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions