I want to access my nested object key in my interface, but I cannot access that. In my first case, the not nested object are can be access in my parameter function, but nested key is cannot. Could you help me to solve this?
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')