Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
650 B
3
Indexable
Never
const updateProductSchema = Yup.object({
  productName: Yup.string().required(),
  sellingPrice: Yup.number().required().min(1),
  costPrice: Yup.number().required().min(1),
  mrpPrice: Yup.number().required().min(1),
  stock: Yup.number().required().min(1),
  description: Yup.string().optional(),
}).unknown(true, { stripUnknown: true });


// field 

  <Formik
          validationSchema={updateProductSchema}
          initialValues={product}
          onSubmit={handleSubmit}
        >
          {(formik) => {
            return (
              <Form>
              // fields 
              </Form>
            );
          }}
        </Formik>