title: React Native - change icon color on press
body: <p>When the 'check' icon is being pressed, I want it to change color from default red to green. In my case, while I have another function for onpress, I use this conditional color statement</p>
  <pre><code>&lt;Icon name=&quot;check&quot; size={20} color={this.state.isCompleted ? '#1DA664' : '#DE5347'} onPress={() =&gt; this.isCompleted(rowData)} isCompleted={this.state.isCompleted}/&gt;
  </code></pre>
  <p>I call this function for onpress</p>
  <pre><code>isCompleted(rowData){
       if (this.state.status != 'new'){
    this.itemsRef.child(rowData.id).update({
      status: 'completed'
    });
    this.setState({
      isCompleted: true
    })
  }
  }
  </code></pre>
  <p>When one of the icon in a list view is pressed, the icon changed color but everytime the color change is the icon of last item.</p>
  <p>As shown in pic,</p>
  <p><a href="https://i.stack.imgur.com/Al5C7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Al5C7.jpg" alt="enter image description here" /></a></p>
  <p>When I press on item 'cook lunch' , it should be the icon in cook lunch turn to green. Instead, the icon in the last item 'hello' changed. What did I do wrong?</p>