Skip to content

Experimental RFC 436 cause component ref type error #2355

Closed
@germsb

Description

@germsb

Hey,
When I use RFC 436

// tsconfig.json
"vueCompilerOptions": {
    "jsxTemplates": true,
    "experimentalRfc436": true
  },

and type vue ref like this

<script setup lang="ts">
import { ref } from 'vue';
import HelloWorld from './components/HelloWorld.vue'
const hello = ref<InstanceType<typeof HelloWorld> | null>();
</script>

<template>
  <HelloWorld ref="hello" msg="Vite + Vue" />
</template>

I get this error

Type '(__VLS_props: {    msg: string;}) => Omit<JSX.Element, "props" | "children"> & Omit<{ $: ComponentInternalInstance; $data: {}; $props: Partial<{}> & Omit<...>; ... 10 more ...; $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (......' does not satisfy the constraint 'abstract new (...args: any) => any'.
  Type '(__VLS_props: { msg: string; }) => Omit<Element, "props" | "children"> & Omit<{ $: ComponentInternalInstance; $data: {}; $props: Partial<{}> & Omit<...>; ... 10 more ...; $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: ...' provides no match for the signature 'new (...args: any): any'.ts(2344)

img

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions