title: React native getting updated state for save
body: <p>I'm quite new to react native and i didn't found any solution to my problem yet so I'm asking here now. I'm trying to update the state of a value on an <code>onPress</code> event of a radio button and save it afterwards. The problem is that the save is getting the non updated value. I know <code>setState</code> is an async call and a <code>forceUpdate</code> is not a recommended solution(and don't work for me for some reason)</p>
  
  <p>here is a sample:</p>
  
  <pre><code>import RadioForm, { 
    RadioButton, 
    RadioButtonInput, 
    RadioButtonLabel
  } from 'react-native-simple-radio-button'
  
  class SomeClass extends Component {
    constructor(props) {
      super(props)
      this.state = {
        buttonValues: [{label: "someValue1", value: 0}, {label: "someValue2", value: 1}],
        someString: "someStringValue_false"
      }
  
      this.handleOnPress = this.handleOnPress.bind(this),
      this.saveValue = this.saveValue.bind(this)
    }
  
    handleOnPress(value) {
      if( value === 1 ){
        this.setState({
          someString: "someStringValue_true"
        })
      } else {
        this.setState({
          someString: "someStringValue_false"
        })
      }
    }
  
     saveValue() {
      //no problem in this function tested already in other cases
     }
  
    render() {
      return( 
        &lt;View&gt;
          &lt;RadioForm
            radio_props={this.state.buttonValues}
            initial={0}
            formHorizontal={true}
            labelHorizontal={true}
            radioStyle={{paddingRight: 20}}
            buttonColor={"red"}
            selectedButtonColor = {"green"}
            animation={true}
            onPress={(value) =&gt; this.handleOnPress(value)}
          /&gt;
          &lt;Button
            title={"save"}
            onPress={()=&gt; this.saveValue()}
          /&gt;
        &lt;/View&gt; 
      )
    }
  }
  </code></pre>
  
  <p>Behavior: the state updates only on the 2nd call</p>