I have a variable called animal
of type ComputedRef<Animal | undefined>
, and I have a function useAnimal
that expects an argument of type ComputedRef<Animal>
.
How can I make it so that I just call the function useAnimal
if the type held by the animal
ComputedRef
is of the type Animal
?
I have tried this:
if (animal.value) {
useAnimal(animal) // Typescript still things animal is of type ComputedRef<Animal | undefined>
}