Skip to content

Conversation

milospp
Copy link

@milospp milospp commented Jun 4, 2025

Issue: #468

Resolves this problem

const reactiveLoading = ref(false)
const { open: openModal, close: closeModal } = useModal({
    component: LoadingComponent,
    attrs: {
        loading: reactiveLoading,
    },
})

Warning

Type 'Ref<boolean, boolean>' is not assignable to type 'boolean'.ts-plugin(2322)
(property) loading: globalThis.Ref<boolean, boolean>
Image

What is Expected?

It should accept both T and Ref<T>

@scott-the-brewer
Copy link

Unfortunately there is know way to reliably know if the props for a component support Ref<T>

Consider the below:

const { title } = defineProps<{ title: string }>()

This won't be reactive, unless toRef it called on title.

Overall, I'm still in favour of this PR - it provides a better developer experience.

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

Successfully merging this pull request may close these issues.

2 participants