We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
vue-final-modal: 4.5.5 vue: 3.5.12 nuxt: 3.14.159
Mac Sequoia 15.5 (24F74)
Cannot reproduce in stackblitz (doesn't see types from lib)
LoadingComponent.vue
const props = defineProps<{ loading: boolean; }>();
Button.vue
const reactiveLoading = ref(false) const { open: openModal, close: closeModal } = useModal({ component: LoadingComponent, attrs: { loading: reactiveLoading, }, })
Type 'Ref<boolean, boolean>' is not assignable to type 'boolean'.ts-plugin(2322) (property) loading: globalThis.Ref<boolean, boolean>
It should accept both T and Ref, the code works, there is only type safety issue
ComponentProps should be updated
export type ComponentProps<T> = T extends new () => { $props: infer P; } ? NonNullable<P> : T extends (props: infer P, ...args: any) => any ? P : {};
Updated version to make props accept both T or Ref
type MaybeRefProps<P> = { [K in keyof P]: Ref<P[K]> | P[K]; } export type ComponentProps<T> = T extends new () => { $props: infer P; } ? MaybeRefProps<NonNullable<P>> : T extends (props: infer P, ...args: any) => any ? P : {};
The text was updated successfully, but these errors were encountered:
hunterliu1003
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Version
vue-final-modal: 4.5.5
vue: 3.5.12
nuxt: 3.14.159
OS
Mac Sequoia 15.5 (24F74)
Reproduction Link
Cannot reproduce in stackblitz (doesn't see types from lib)
Steps to reproduce
LoadingComponent.vue
Button.vue
Type 'Ref<boolean, boolean>' is not assignable to type 'boolean'.ts-plugin(2322)

(property) loading: globalThis.Ref<boolean, boolean>
What is Expected?
It should accept both T and Ref, the code works, there is only type safety issue
What is actually happening?
ComponentProps should be updated
Updated version to make props accept both T or Ref
The text was updated successfully, but these errors were encountered: