How do we pass a ref
to a child prop without getting it unwrapped by Vue? I have tried several things including toRef
, reactive
, shallowRef
among others, but it keeps complaining about the type of this prop not matching the passed value. I'm using latest Vue with Typescript and script setup
.
Child component
Defines a prop of type Ref<Canvas>
(Canvas
is from fabric.js
):
const props = defineProps<{
canvas: Ref<Canvas>
}>()
Parent component
<ChildComponent :canvas="c" />
...
const c = ref<Canvas>(theCanvasObject)
...