Reputation: 93
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?
Upvotes: 0
Views: 2756
Reputation: 6940
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
.
Upvotes: 2