You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem with Formik, Yup and ReactQuill: I have the following code with my ReactQuill component working but for some reason errors messages send by Yup are never shown, like if ReactQuill and Formik value aren't synced. When I submit the form I correctly see the ReactQuill values trough.
I think you'd want something a little more sophisticated than required(), because anything that isn't a vanilla field will almost always at least have an empty paragraph tag in it as a string.
A custom validator using addMethod is probably better, something that validates like this:
constcontent=newDOMParser().parseFromString(value,'text/html')?.body.textContent?.trim()??'';if(content===''){// Field is empty}else{// Field has text content}
Hello,
I have a problem with Formik, Yup and ReactQuill: I have the following code with my ReactQuill component working but for some reason errors messages send by Yup are never shown, like if ReactQuill and Formik value aren't synced. When I submit the form I correctly see the ReactQuill values trough.
Yup schema:
Formik & ReactQuill:
The text was updated successfully, but these errors were encountered: