-
This is what I do: const initialValues = {
header: {
year: new Date().getFullYear() - 1,
month: 12,
economicMonth: 12,
type: null,
currency: null,
},
items: {}, // Record<string, number | null>
}
const validationSchema = {
header: {
year: { required: true, integer: true, min: [new Date().getFullYear() - 10], max: [new Date().getFullYear() + 10] },
month: 'required|integer|min:1|max:12',
economicMonth: 'required|integer|min:1|max:12',
type: 'required',
currency: 'required',
},
}
const { values: formValues } = useForm({ validationSchema, initialValues }) But I get only error If I remove the Is this supported only with yup used for schema generation? |
Beta Was this translation helpful? Give feedback.
Answered by
logaretm
Jul 10, 2022
Replies: 1 comment 1 reply
-
Yes, sadly this is only supported for yup at the moment. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Liwoj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, sadly this is only supported for yup at the moment.