title: How to Set Initial Values to Formik using Axios with Typescript
body: <p>I am new to using React, Formik, and Axios and not sure how to set the form's initial values from a database call.  I have tried below code snippet, but have not been successful.  I am unable to find any typescript examples online on how to do this.</p>
  
  <pre><code>async function getInitialValues() {
        try {
              const response = await axios.get('http://localhost:53132/api/test');
              //console.log(response);
  
  
              return {
                  Division_Id: response.Divison_Id,
                  Year: response.Year,
                  Cost: response.Cost
              }
  
              //console.log(InitialValues);
  
              //return InitialValues;
  
  
            } catch (error) {
              console.error(error);
            }
      }
  
  
  &lt;Formik initialValues={getInitialValues()}...
  
  </code></pre>