Different function calls on success of both RightToLeftSwipe and LeftToRightSwipe
Closed this issue · 1 comments
NishilE commented
Hi, I wanted to use both LeftToRightSwipe and RightToLeftSwipe and call different functions . Is that possible at the moment ?
UdaySravanK commented
Hi @NishilE , Currently this component has only one callback for both types. This is because the same button cannot have both behaviors at the same time.
If you want you can have it implemented as below
const YourComponent = ({isRTL = false, rtlCallback, regularCallback}) => {
return (
<>
{ isRTL ?
<SwipeButton onSwipeSuccess={rtlCallback} enableRightToLeftSwipe/> :
<SwipeButton onSwipeSuccess={regularCallback} />
}
</>
)
}
Please close this issue if this response answers your question. Feel free to discuss further if you have more questions.