title: Yup validation schema object conditional validation
body: <p>I want to baisically say if type = 1 then validate the membership object , did try it with .when() but had to do it with eacth of the object (only when type =1 then validate</p>
  <pre><code> validationSchema={Yup.object().shape({
                          //General
                          name: Yup.string().min(3).required('Name is required.'),
                          email: Yup.string().email().required('Email is required.'),
                          contactNo: Yup.number().required('Number is required.'),
                          address: Yup.string().required('Address is required.'),
                          country: Yup.string().required('Country is required.'),
      
      
                          memberShip: Yup.object() 
                          .shape({
  //Something like this
  if(type ===1){
                              memberShipNo: Yup.string().required('MemberShip Number is required.'),
                              memberShipStart: Yup.string().required( 'MemberShip Number is required.'),
                              fee: Yup.string().required('MemberShip Number is required.')},
                          }),
                          
                       
      
                          verified: Yup.bool(),
                      })}
  </code></pre>