Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental RFC 436 cause component ref type error #2355

Closed
germsb opened this issue Feb 2, 2023 · 1 comment
Closed

Experimental RFC 436 cause component ref type error #2355

germsb opened this issue Feb 2, 2023 · 1 comment

Comments

@germsb
Copy link

germsb commented Feb 2, 2023

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

@johnsoncodehk
Copy link
Member

See #1987 (comment)

@germsb germsb closed this as completed Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants