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
And my error is:
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.
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 :![image](https://user-images.githubusercontent.com/94893406/231394505-2fdd4cc5-e673-4a62-8e7b-3895d1a7e289.png)
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 formAnd my error is:![image](https://user-images.githubusercontent.com/94893406/231395523-05744dc0-168d-4ff8-a6e9-c857254700a6.png)
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 !