본문 바로가기
오류

Argument of type 'Ref<x>' is not assignable to parameter of type 'x'

by 신방동불주먹 2024. 4. 26.

https://stackoverflow.com/questions/71834444/argument-of-type-refx-is-not-assignable-to-parameter-of-type-x

 

Argument of type 'Ref<x>' is not assignable to parameter of type 'x'

Using the new Composition API I am trying to get data from an input and pass it to a function which expects a string. However, TypeScript is complaining the types don't match up because one is a Re...

stackoverflow.com

 

const name = ref('')

name       // <-- Ref object
name.value // <-- string