title: How to truncate value in React Native Formik form field
body: <p>I have a field where I only want the length to be 3 numbers long max. I am using Yup, however, it only notifies the user of the error, it doesn't stop the user from entering a number longer than desired. </p>
  
  <p>To fix this I created a function that slices the input value. This looks like it works, it keeps the length in the form field to what I want, however, when I click submit the value for the field is the unsliced version.</p>
  
  <p>Here is my code...</p>
  
  <pre><code>            &lt;TextInput
                style={styles.text}
                value={_checkLength(values.number, 3)}
                onChangeText={handleChange('number')}
                onBlur={() =&gt; setFieldTouched('number')}
                placeholder="Number"
              /&gt;
  </code></pre>
  
  <p>My _checkLength function is simple...</p>
  
  <pre><code>_checkLength = (value, length) =&gt; {
    return value.slice(0, length)
  }
  </code></pre>
  
  <p>Why is this not working?</p>