Relative Content

Tag Archive for reactjsformikyup

How to use yup in stepper form

I make a stepper formik form and the objective is yup should validate each step of the form. this is my validation schema:

.test method error per field when validating with yup in formik

const checkEmailDuplicate = async (email: string): Promise<boolean> => { const isDuplicate = await emailDuplicate(email); if (isDuplicate) { return false; } return true; }; const checkUsernameDuplicate = async (name: string): Promise<boolean> => { const isDuplicate = await usernameDuplicate(name); if (isDuplicate) { return false; } return true; }; const SignupSchema = Yup.object<SignupFormValues>().shape({ user_email: Yup.string() .required(“Please enter an […]