title: change increment and decrement number with two button React native
body: <pre><code>class Search extends React.Component {
  
    constructor(props){
      super(props);
      this.state = {count : 0}
  
      this.M = {Message : &quot; &quot;}
      this.increment = this.increment.bind(this);
      this.decrement = this.decrement.bind(this);
      this.result = this.result.bind(this);
      this.result();
  
    }
  
    increment(){
      this.setState({count : this.state.count + 1}) ;
      this.result()
      this.forceUpdate();
    }
  
    decrement() {
      this.setState({count : this.state.count - 1});
      this.result()
      this.forceUpdate();
    }
  
    result() {
      if (this.state.count &gt;0)
      {
        this.forceUpdate();
        //  this.setState({Message : &quot;positive&quot;});
        this.M.Message = &quot;Positive&quot;;
        // this.forceUpdate();
      } else 
      {  
        this.M.Message = &quot;Negative&quot;;
        // this.forceUpdate();
  
        // this.setState({Message : &quot;NEGATIVE &quot;});
  
      }
      this.forceUpdate();
     
    }
  
  
  
  // }
  render() {
      return (
        &lt;View&gt;
                  &lt;Text style = {{margin: 45, fontSize: 22}}&gt;you have  {this.state.count} Coin&lt;/Text&gt;
                  &lt;Button 
                        onPress={this.increment}
                        title=&quot;win Coin &quot;
                        color=&quot;#841584&quot; /&gt;
                  &lt;Button
                        onPress = {this.decrement}
                        title=&quot;lose Coin&quot;
                        color=&quot;#841584&quot; /&gt;
  
  
                        &lt;Text style = {{fontSize : 28}}&gt; Result :  {this.M.Message} &lt;/Text&gt;
         &lt;/View&gt;
      )  
    }
  }
  </code></pre>
  <p>**the bug is when the count equal 0 or -1 it has the result of the prevents exemple one the user click on lose Coin the result is -1 so the  message is &quot;negative&quot; but when he click another time  on the button win coin the result get 0 and the result is not Positive but Negative the precedent result and just for the two result is 0 and -1 **</p>