title: How to re-render Formik values after updated it - React Native?
body: <p>I have a screen for update previously data "name, email, age, etc". at the first time I call a function that gets data from server name as <code>getProfileData()</code></p>
  
  <p>after user write the new data I send a POST request for that "update Profile"</p>
  
  <p>and it's a success, but after that, I want to re-render this form with new data, So i call the <code>getProfileData()</code> function to get new data but it's not working to re-render Input Values! 
  it's just still with previous data</p>
  
  <p>I also try with <code>componentDidUpdate()</code> but sadly not re-render :)</p>
  
  <p>So how can i solve it?</p>
  
  <p>Code </p>
  
  <pre><code>getProfileData = async () =&gt; {
      let USER_TOKEN =
        '....';
      let AuthStr = `Bearer ${USER_TOKEN}`;
      let response = await API.get('/profile', {
        headers: {Authorization: AuthStr},
      });
      let {
        data: {data},
      } = response;
      let password = '';
      let password_confirmation = '';
      let {name, email, avatar, age, gender, country_id} = data;
      let initialValues = [];
      initialValues.push({
        name,
        password,
        password_confirmation,
        email,
        avatar,
        age,
        gender,
        country_id,
      });
      this.setState({initialValues: initialValues, loading: false}, () =&gt;
        reactotron.log(this.state.initialValues[0]),
      );
    };
  
  
    updateProfile = async value =&gt; {
      let USER_TOKEN =
        '....';
      let AuthStr = `Bearer ${USER_TOKEN}`;
      const headers = {
        'Content-Type': 'application/json',
        Authorization: AuthStr,
      };
      let response = await API.post('/update_profile', value, {
        headers: headers,
      });
      let {
        data: {data},
      } = response;
      alert(data);
      this.getProfileData(); // called 
    };
  
  
   componentDidMount() {
      this.getCountryList();
      this.getProfileData();
    }
    componentDidUpdate(prevProps, prevState) {
      if (prevState.initialValues !== this.state.initialValues) {
        console.log('componentDidUpdate', this.state.initialValues);
        this.setState({initialValues: this.state.initialValues});
      }
    }
  </code></pre>
  
  <p>UI</p>
  
  <pre><code>&lt;Formik
                    validationSchema={formSchema}
                    initialValues={this.state.initialValues[0]}
                    onSubmit={(values, actions) =&gt; {
                      this.updateProfile(values);
                      reactotron.log(values), actions.resetForm();
                    }}&gt;
                    {({
                      handleChange,
                      handleBlur,
                      touched,
                      errors,
                      handleSubmit,
                      values,
                      setFieldValue,
                    }) =&gt; (
                      &lt;View&gt;
                        &lt;Item style={styles.item} floatingLabel&gt;
                          &lt;Label style={styles.formLabel}&gt;name&lt;/Label&gt;
                          &lt;Input
                            style={styles.value}
                            rounded
                            onChangeText={handleChange('name')}
                            onBlur={handleBlur('name')}
                            value={values.name}
                          /&gt;
                        &lt;/Item&gt;
                        &lt;Text style={styles.errorText}&gt;
                          {touched.name &amp;&amp; errors.name}
                        &lt;/Text&gt;
                   &lt;/View&gt;
               )}
   &lt;/Formik&gt;
  </code></pre>