diff --git a/packages/nuxt/src/app/components/nuxt-link.ts b/packages/nuxt/src/app/components/nuxt-link.ts index 3694b58df9..26a2a20b0b 100644 --- a/packages/nuxt/src/app/components/nuxt-link.ts +++ b/packages/nuxt/src/app/components/nuxt-link.ts @@ -497,11 +497,11 @@ export function defineNuxtLink (options: NuxtLinkOptions) { } }, // }) as unknown as DefineComponent> - }) as unknown as new(props: NuxtLinkProps) => InstanceType(props: NuxtLinkProps) => InstanceType, [], SlotsType> - >> + >>) & Record } export default defineNuxtLink(nuxtLinkDefaults) diff --git a/test/fixtures/basic-types/types.ts b/test/fixtures/basic-types/types.ts index 70c7fcf635..c2b1115d5a 100644 --- a/test/fixtures/basic-types/types.ts +++ b/test/fixtures/basic-types/types.ts @@ -255,6 +255,9 @@ describe('typed router integration', () => { // @ts-expect-error this is an invalid param h(NuxtLink, { to: { name: 'param-id', params: { bob: 23 } } }) h(NuxtLink, { to: { name: 'param-id', params: { id: 4 } } }) + + // doesn't throw an error when accessing properties of component + const _props = NuxtLink.props }) })