fix(Form)!: resolve async validation in yup & issue directly mutate state (#2702)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
kyyy
2024-11-24 01:30:20 +07:00
committed by GitHub
parent 3bccb6782a
commit c9806da6d8
3 changed files with 4 additions and 5 deletions

View File

@@ -72,7 +72,7 @@ async function validateYupSchema(
schema: YupObjectSchema<any>
): Promise<ValidateReturnSchema<typeof state>> {
try {
const result = schema.validateSync(state, { abortEarly: false })
const result = await schema.validate(state, { abortEarly: false })
return {
errors: null,
result