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?