title: How to animate a single item from Flatlist
body: <p>I have a array of data which I render in flatlist in React-Native. On pressing one of the items I want it to fade away, but instead all items on the flatlist get animated and not just the one that I pressed on.</p>
  
  <pre><code>constructor(props){ 
  super(props); 
  this.state = { fadeAnim: new Animated.Value(1) }
  
  
  
    onPressButtonnotdelivered(item) {
      //Alert.alert(item.name)
        const animations = [
          Animated.timing(this.state.fadeAnim, {
            toValue: 0,
            duration: 500
          }),
  
        ];
  
        Animated.sequence(animations).start()
    }
  
  
    render() {
  return (
    &lt;View&gt;
      &lt;FlatList
        data={this.state.data}
        extraData={this.state}
        keyExtractor={item =&gt; item.id}
        renderItem={({ item, index }) =&gt; {
          return (
            &lt;Animated.View key={index} style={[styles.animatedview, {opacity: this.state.fadeAnim}]}&gt;
      &lt;View&gt;
      &lt;View style={[styles.button, {backgroundColor: '#E94F64'}]}&gt;
      &lt;TouchableOpacity style={styles.buttonview}
      onPress={() =&gt; {this.onPressButtonnotdelivered(item)}}&gt;
    &lt;View style={styles.btnIcon}&gt;
    &lt;Icon name="block" size={30} /&gt;
      &lt;Text&gt;Not delivered&lt;/Text&gt;
    &lt;/View&gt;
  &lt;/TouchableOpacity&gt;
  &lt;/View&gt;
            &lt;/View&gt;
            &lt;/Animated.View&gt;
          );
        }}
      /&gt;
    &lt;/View&gt;
  );
    }
  </code></pre>