title: How to get values from react FieldArray in formik form with other fields?
body: <p>I have created a Formik form that contains a field array, form and <code>fieldArray</code> is in two separate classes as separate components.</p>
  
  <p>My form:</p>
  
  <pre><code>&lt;Formik onSubmit = {(values, { setSubmitting }) =&gt; { setSubmitting(false);}}
          enableReinitialize&gt;
      {({handleSubmit, errors})=&gt; (
          &lt;Form onSubmit= { handleSubmit }&gt;
              &lt;Form.Group as= { Row } controlId= "cpFormGroupTitle" className="required"&gt;
                  &lt;Form.Label className="post-create-label"  column sm={ 2 } &gt;
                      Title
                  &lt;/Form.Label&gt;
                  &lt;Col sm={ 10 }&gt;
                      &lt;Field name="title" component={ renderTextField } type="text"
                             isinvalid={ !!errors.title ? "true": "false" }
                             placeholder="Title *" /&gt;
                  &lt;/Col&gt;
              &lt;/Form.Group&gt;
              &lt;Form.Group as= { Row } controlId= "cpFrmGroupShortDesc"  className="required"&gt;
                  &lt;Form.Label className="post-create-label"  column sm={ 2 } &gt;
                      Short Description
                  &lt;/Form.Label&gt;
                  &lt;Col sm={ 10 }&gt;
                      &lt;Field name="short-desc" component={ renderTextArea } type="text"
                             isinvalid={ !!errors.shortDescription ? "true": "false" }
                             placeholder="Short Description *" /&gt;
                  &lt;/Col&gt;
              &lt;/Form.Group&gt;
              &lt;Form.Group as= { Row } controlId= "cpFormGroupFeatures"&gt;
                  &lt;Form.Label className="post-create-label"  column sm={ 2 }&gt;
                      Features
                  &lt;/Form.Label&gt;
                  &lt;Col sm={ 10 }&gt;
                      &lt;TextFieldArray initialValues={{ features: [] } } name="features"/&gt;
                  &lt;/Col&gt;
              &lt;/Form.Group&gt;
              &lt;Form.Group as={ Row }&gt;
                  &lt;Col sm= { { span: 2, offset:2 } }&gt;
                      &lt;Button type="submit"  variant="primary"&gt;Submit&lt;/Button&gt;
                  &lt;/Col&gt;
                  &lt;Col sm={ 2 }&gt;
                      &lt;Button variant="secondary"&gt;Save as draft&lt;/Button&gt;
                  &lt;/Col&gt;
              &lt;/Form.Group&gt;
          &lt;/Form&gt;
      )}
  &lt;/Formik&gt;
  </code></pre>
  
  <p>Here, <code>&lt;TextFieldArray&gt;</code> is field array , I need to get values from field array when form is submitted.</p>
  
  <p>TextFieldArray:</p>
  
  <pre><code>export const TextFieldArray = (props) =&gt; (
      &lt;React.Fragment&gt;
          &lt;Formik initialValues= { props.initialValues } render={({ values }) =&gt; (
              &lt;Form&gt;
                  &lt;FieldArray name= { props.name } render={arrayHelper =&gt; (
                      &lt;div&gt;
                          { values[props.name] &amp;&amp; values[props.name].length &gt; 0 ?
                              (
                                  values[props.name].map((item, index) =&gt; (
                                      &lt;div key={index}&gt;
                                          &lt;Form.Group as= { Row }&gt;
                                              &lt;div className="col-md-8"&gt;
                                                  &lt;Field name={`${props.name}.${index}`}
                                                         className="form-control"/&gt;
                                              &lt;/div&gt;
                                              &lt;div className="col-md-2"&gt;
                                                  &lt;Button type="button" variant="outline-secondary"
                                                          onClick={() =&gt; arrayHelper.remove(index)}&gt;
                                                      Remove
                                                  &lt;/Button&gt;
                                              &lt;/div&gt;
                                              &lt;div className="col-md-2"&gt;
                                                  &lt;Button type="button" variant="outline-secondary"
                                                      onClick={() =&gt; arrayHelper.insert(index, '')}&gt;
                                                      Add
                                                  &lt;/Button&gt;
                                              &lt;/div&gt;
                                          &lt;/Form.Group&gt;
                                      &lt;/div&gt;
                                  ))
                              ) : (
                                  &lt;Button type="button" variant="outline-secondary"
                                          onClick={() =&gt; arrayHelper.push('')} &gt;
                                     {`Add ${ props.name }`}
                                  &lt;/Button&gt;
                              )
                          }
                      &lt;/div&gt;
                  )} /&gt;
              &lt;/Form&gt;
          )} /&gt;
      &lt;/React.Fragment&gt;
  );
  </code></pre>
  
  <p>I'm a beginner to ReactJS, so someone help me please, that will be huge help from you all.
  Thanks.</p>