title: How I can validate object inside objects in yup?
body: <p>I'm using formik with yup to treat my forms and i need to validate two objects that is setted by formik in initial values:</p>
  
  <pre><code>initialValues: {
    company: { company_name: '', cnpj: '', fantasy_name: '', state_registration: '' },
    user: { email: '', password: '' }
  },
  validationSchema: schema,
  </code></pre>
  
  <p>So this is my validation yup schema:</p>
  
  <pre><code>  const schema = Yup.object().shape({
      company_name: Yup.string().required('Informe o nome da filial!'),
      cnpj: Yup.string().required('Informe o cnpj!'),
      email: Yup.string().email('Email não possui formato válido').required('Informe o e-mail'),
      password: Yup.string().required('Informe a senha')
    })
  </code></pre>
  
  <p>How i can put one more level (user/company)?
  I tried something like:</p>
  
  <pre><code>company.company_name: Yup.string().required('Informe o nome da filial!')
  </code></pre>
  
  <p>But i receive:</p>
  
  <blockquote>
    <p>Parsing error: Unexpected token, expected ","</p>
  </blockquote>
  
  <p>How i can do this?</p>
  
  <p>I also tried:</p>
  
  <pre><code>  const schema = Yup.object().shape({
      company: Yup.object().shape({
        company_name: Yup.string().required('Informe o nome da filial!'),
        cnpj: Yup.string().required('Informe o cnpj!'),
      }),
      user: Yup.object().shape({
        email: Yup.string().email('Email não possui formato válido').required('Informe o e-mail'),
        password: Yup.string().required('Informe a senha')
      })
    })
  </code></pre>
  
  <p>But i receive:</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'company_name' of undefined</p>
  </blockquote>
  
  <p>My template component:</p>
  
  <pre><code>&lt;TextField
            value={formik.values.company.company_name}
            onChange={formik.handleChange}
            onBlur={formik.handleBlur} 
            helperText={formik.touched.company.company_name ? formik.errors.company.company_name : ""}
            error={formik.touched.company &amp;&amp; Boolean(formik.errors.company)}
            variant="outlined"
            margin="normal"
            required
            fullWidth
            id="company_name"
            label="Razão social"
            name="company_name"
          /&gt;
  </code></pre>