3DJakob / react-tinder-card-demo

This is a demo for react-tinder-card which is a react module for making elements behave like cards in the ever so popular dating app tinder.

Home Page:https://3djakob.github.io/react-tinder-card-demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass event.target.value to onSwipe function

hichemfantar opened this issue · comments

Is it possible to do this? I would like to pass the key property value to the onSwipe function.
<TinderCard
className="swipe"
//key={person.name}//
key={person.email}
preventSwipe={["up", "down"]}
onSwipe={(e) => onSwipe(e.target.key)}
flickOnSwipe={true}
>

No there is no event passed onSwipe. I'm a bit unsure what you expect the output to be there. Per default it outputs the direction swiped as a string like this.

onSwipe={(directionAsString) => onSwipe(directionAsString)}

Does this answer your question?