react-hook-form Yup resolver is not working #11342
https://github.com/orgs/react-hook-form/discussions/11342
Finally got it to work:
useForm({
// ...
resolver: yupResolver(schema),
})
// ...
await trigger()
// Important Note: given time/ticks to make formState.errors working with yup schema
await sleep(0);
formState.errors // is ok with yup schema
// with util
export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));