title: react-native error : value for date cannot be cast from string to double
body: <p>So, I have this <code>reminder component</code> with textInput being imported from react-native and DatePicker being imported from the native base and a button which will save the form on click event.</p>
  
  <p>now when I click on the datepicker, it gives an error saying: <code>value for date cannot be cast from string to double</code>. I have also attached a screenshot of the error.</p>
  
  <p><a href="https://i.stack.imgur.com/LptKT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LptKT.png" alt="Error screenshot"></a></p>
  
  <p>not sure where I am going wrong.</p>
  
  <p>this is the component's code.</p>
  
  <pre><code>class Reminder extends Component {
  
      constructor(props) {
          super(props);
          let formatDate = new Date();
          this.state = {
              chosenDate: formatDate.toISOString().split('T')[0],
              text: '',
          };
          this.handleChangeInput = this.handleChangeInput.bind(this);
          this.saveData = this.saveData.bind(this);
      }
  
  
      render() { 
          const {chosenDate} = this.state;
          return ( 
              &lt;View&gt;
                  &lt;Form style={styles.formContainer}&gt;
                      &lt;View style={styles.formView}&gt;
  
                          &lt; TextInput
                              placeholder = "Set your reminder"
                              onChangeText={this.handleChangeInput}
                              value={this.state.text}
                          /&gt;
  
                          &lt;DatePicker
                              defaultDate={chosenDate}
                              mode = "date"
                              animationType={"fade"}
                              androidMode={"default"}
                              placeHolderText="Select date"
                              textStyle={{ color: "green" }}
                              placeHolderTextStyle={{ color: "#d3d3d3" }}
                              onDateChange={(chosenDate) =&gt; this.setState({chosenDate})}
                          /&gt;
                          &lt;Text style={styles.datePicker}&gt;
                              {chosenDate}
                          &lt;/Text&gt;
                      &lt;/View&gt;
                      &lt;View style={styles.footer}&gt;
                          &lt;Button block success style={styles.saveBtn} 
                              onPress={ () =&gt; 
                                      {
                                      this.saveData()
                                      //console.log('save data', fomattedState);
                                      Alert.alert('Yay!!', 'Succefully saved.')
                                      }
                                  } 
                             &gt;
                              &lt;Icon type='MaterialIcons' name='done' /&gt;                        
                          &lt;/Button&gt;
                      &lt;/View&gt;
                  &lt;/Form&gt;
              &lt;/View&gt; 
          );
      }
  
      handleChangeInput = (input) =&gt; {
          this.setState({
              text: input
          });
      }
  
      //save the input
      saveData() {
          let {chosenDate, ...restOfState} =  this.state;
          let textArray = Object.entries(restOfState).map(([key, value])=&gt; ({[key]: value}));
          let fomattedState = {[chosenDate]:textArray};
          console.log('formatted state', fomattedState);
          AsyncStorage.setItem("key", JSON.stringify(this.fomattedState));
      }
  }
  </code></pre>