snippet in react js

    0

    0

    Hazrat Anas

    This code defines a form with four fields. The first three fields are required, and the last field is optional. When the user clicks the "Slide Show" button, the code sets the form data using the values property.

    Library: react

    import { useFormik } from 'formik';
    import * as Yup from 'yup';
    
    initialValues: {
        position: formData.position,
        firstName: formData.firstName,
        lastName: formData.lastName,
        email: formData.email,
        password: formData.password,
        repeatPassword: formData.repeatPassword
      },
    
      validationSchema: Yup.object({
        position: Yup.string().required('Required'),
        firstName: Yup.string().required('Required'),
        lastName: Yup.string().required('Required'),
        email: Yup.string().required('Required'),
        password: Yup.string().required('Password is Required'),
        repeatPassword: Yup.string().oneOf([Yup.ref('password'), null], 'Passwords must match')
      }),
      onSubmit: values => {
        $(document).ready(function () {
          const name = $(".slide_button button")
          console.log(name[2])
          name[2].click()
          setformdata(values)
        });
    
    
      },
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.