0

I am currently building a mobile application like tinder using react native, I use Deck Swiper from native base package and I don't find a solution on how to swipe card when then button clicks.

This link is the Deck Swiper Component from native base that I've been using: http://nativebase.io/docs/v0.5.13/components#deckSwiper

Any suggestions or idea on how to swipe cards with button click?

Ryan Angelo
  • 93
  • 1
  • 13

1 Answers1

2

First, you need to save the reference of the DeckSwiper component:

<DeckSwiper ref={(deck) => this.deck = deck}>

Later, you can use this.deck.swipeRight() or this.deck.swipeLeft.

Eldelshell
  • 6,683
  • 7
  • 44
  • 63