title: POST request sent on a second or a third click of the input button, why?
body: <p>So everything in my code works pretty much as intended only the post request is sent on a second or maybe even on a third click on the button... I am guessing that it has something to to with the way I am updating redux state, but my brain froze, can someone please point out to me where is my mistake?</p>
  
  <p>Cheers!</p>
  
  <pre><code>class AddressScreen extends Component {
    state = {
      usersNickOrName: "",
      usersAddress: "",
      usersPhoneNumber: ""
    };
  
    onPressHandler = () =&gt; {
      this.props.deliveryInfo(
        this.state.usersNickOrName,
        this.state.usersAddress,
        this.state.usersPhoneNumber
      );
  
      let uid = this.props.uid;
  
      axios.post(
        `.../users/${uid}/info.json`,
        {
          nameOrNick: this.props.name,
          address: this.props.address,
          phoneNum: this.props.phoneNum
        }
      );
      this.props.navigator.pop();
    };
  
    render() {
      return (
        &lt;View style={styles.container}&gt;
  
          &lt;AnimatedForm delay={100} distance={10}&gt;
            &lt;AnimatedInput
             onChangeText={text =&gt; {
                this.setState({ usersNickOrName: text });
              }}
            /&gt;
            &lt;AnimatedInput
              onChangeText={text =&gt; {
                this.setState({ usersAddress: text });
              }}
            /&gt;
            &lt;AnimatedInput
              onChangeText={text =&gt; {
                this.setState({ usersPhoneNumber: text });
              }}
            /&gt;
  
            &lt;Animated.View style={styles.buttonView}&gt;
              &lt;TouchableOpacity
                style={styles.button}
                onPress={this.onPressHandler}
              &gt;
                &lt;Text style={{ color: "#fff" }}&gt;Dodaj Info&lt;/Text&gt;
              &lt;/TouchableOpacity&gt;
            &lt;/Animated.View&gt;
          &lt;/AnimatedForm&gt;
        &lt;/View&gt;
      );
    }
  }
  
  
  
  const mapStateToProps = state =&gt; {
    return {
      name: state.usersNickOrName,
      address: state.usersAddress,
      phoneNum: state.usersPhoneNumber,
      uid: state.userUid
    };
  };
  
  const mapDispatchToProps = dispatch =&gt; {
    return {
      deliveryInfo: (usersName, usersAddress, phoneNum) =&gt;
        dispatch(deliveryInfo(usersName, usersAddress, phoneNum))
    };
  };
  
  export default connect(
    mapStateToProps,
    mapDispatchToProps
  )(AddressScreen);
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>What I did is, I have put my redux update state in componentWillUpdate and removed it from onPressHandler. Now it works almost like intended, for example if I enter London Str. 36 it will POST request London Str. 3, it wont send last letter or number to server... How come?</p>
  
  <pre><code>componentWillUpdate() {
      this.props.deliveryInfo(
        this.state.usersNickOrName,
        this.state.usersAddress,
        this.state.usersPhoneNumber
      );
    }
  </code></pre>