title: Access Formik's values outside of component | React
body: <h2>Some info</h2>
  
  <p>I am using Formik for my project and I have my setup looking like this:</p>
  
  <pre><code>|-MenuModal
  |--MenuEdit
  |---MenuEditForm
  </code></pre>
  
  <p>Where <code>MenuModal</code> is the parent to <code>MenuEdit</code> and <code>MenuEditForm</code>. The component <code>MenuEditForm</code> is responsible for returning the Formik form, but I am calling the submit in it's parent <code>MenuModal</code>, which laters runs the submit function in <code>MenuEdit</code> via React's refs. Messy? Yup!</p>
  
  <h2>My problem</h2>
  
  <p>Right now I am trying to use state and callback functions to get the Formiks <code>values</code> from <code>MenuEditForm</code> to <code>MenuEdit</code>. But since I am not using Formiks own <code>onSubmit</code>:</p>
  
  <pre><code>    &lt;Formik
          initialValues={menu}
          validationSchema={validationSchema}
          onSubmit={values =&gt; console.log('values', values)} // 'values' is undefined
          ...
  </code></pre>
  
  <p>My <code>values</code> will be undefined and I can't make my submit function go through. </p>
  
  <p>So I wonder how I can access my <code>values</code> in <code>MenuEditForm</code> so I later can pass it up to <code>MenuEdit</code> and complete my submit function.</p>
  
  <p>Thanks for reading.</p>