react-native-card-stack-swiper icon indicating copy to clipboard operation
react-native-card-stack-swiper copied to clipboard

How to use it in Functional Component

Open maazshaikh1711 opened this issue 4 years ago • 1 comments

Passing ref props in CardStack gives an error ref = {this.swiper = swiper } this gives an error

maazshaikh1711 avatar Jan 13 '22 08:01 maazshaikh1711

Hello, these lines might help.

let swiper: any = useRef(null);

<CardStack ref={swiper} ...

onPress={() => swiper.current?.swipeLeft()}

<TouchableWithoutFeedback onPress={() => swiper.current?.swipeRight()}> <MaterialIcons name="favorite" size={30} color={colors.icon} /> </TouchableWithoutFeedback>

AhmedTN90 avatar Feb 09 '22 21:02 AhmedTN90