I'm facing an issue with accessing a nested object key in my interface. In my scenario, I am able to access non-nested object keys in my parameter function, but the nested key seems inaccessible. Can anyone provide assistance on how to resolve this issue?
function myFunc<T extends object>(): {
watch: (type: keyof T) => void
} {
return { watch: () => {} }
}
interface Props {
name: string
age: number
height: {
ok: boolean
}
}
const { watch } = useForm<Props>()
watch('age')