title: React Native Swipeable close after onPress not working
body: <p>So I've seen many posting the same problem, but for some I don't seem to be able to adapt the posted solutions to my case.. I hope someone can tell me exactly what changes I need to do in order to get this working, since I don't know how to implement the suggested solutions!</p>
  
  <p>I am using <a href="https://software-mansion.github.io/react-native-gesture-handler/docs/component-swipeable.html" rel="nofollow noreferrer">React Native Swipeable</a></p>
  
  <p><a href="https://stackoverflow.com/questions/59022104/react-native-swipeable-swipe-to-delete-not-closing">Example of someone having the same issue</a> </p>
  
  <p>I have a file in which I built the Swipeable Component and an other class which calls the component. I've set a timeout close function on the onSwipeableOpen as a temporary solution. But ideally it should close immediately upon pressing "delete". The "..." stands for other code which I deleted since it's not important for this case.</p>
  
  <p><strong>AgendaCard.js</strong></p>
  
  <pre><code>...
  const RightActions = ({ onPress }) =&gt; {
    return (
      &lt;View style={styles.rightAction}&gt;
        &lt;TouchableWithoutFeedback onPress={onPress}&gt;
          &lt;View style={{ flexDirection: "row", alignSelf: "flex-end" }}&gt;
            &lt;Text style={styles.actionText}&gt;Löschen&lt;/Text&gt;
            &lt;View style={{ margin: 5 }} /&gt;
            &lt;MaterialIcons name="delete" size={30} color="white" /&gt;
          &lt;/View&gt;
        &lt;/TouchableWithoutFeedback&gt;
      &lt;/View&gt;
    );
  };
  ...
  export class AgendaCardEntry extends React.Component {
    updateRef = (ref) =&gt; {
      this._swipeableRow = ref;
    };
    close = () =&gt; {
      setTimeout(() =&gt; {
        this._swipeableRow.close();
      }, 2000);
    };
    render() {
      return (
        &lt;Swipeable
          ref={this.updateRef}
          renderRightActions={() =&gt; (
            &lt;RightActions onPress={this.props.onRightPress} /&gt;
          )}
          onSwipeableOpen={this.close}
          overshootRight={false}
        &gt;
          &lt;TouchableWithoutFeedback onPress={this.props.onPress}&gt;
            &lt;View style={styles.entryContainer}&gt;
              &lt;Text style={styles.entryTitle}&gt;{this.props.item.info}&lt;/Text&gt;
              &lt;Text style={styles.entryTime}&gt;
                eingetragen um {this.props.item.time} Uhr
              &lt;/Text&gt;
            &lt;/View&gt;
          &lt;/TouchableWithoutFeedback&gt;
        &lt;/Swipeable&gt;
      );
    }
  }
  </code></pre>
  
  <p><strong>Agenda.js</strong></p>
  
  <pre><code>...
  renderItem(item) {
  ...
  &lt;AgendaCardAppointment
          item={item}
          onRightPress={() =&gt; firebaseDeleteItem(item)}
        /&gt;
  ...
  }
  </code></pre>