Error schema validation with Yup
Lefevcal opened this issue · 0 comments
Hello, I have an error when i tried to validate a form with yup which has a jodit textarea input.
I use react-hook-form for forms.
This is my form for a mail with validation :
This is my textarea input component:
<JoditEditor ref={fieldRef} value={content} config={config} onBlur={(newContent) => setContent(newContent)} />
where content is the value of the input named body of my form
I tried to set up the validation in the onSubmit function but I have the same error when I tried to make:
form.setError('body', { type: 'custom', message: 'error'})
To overcome this problem I add a field in the form to make the validation but I don't like this method and I would like to have your opinions.
Thanks for advance !