ref is not working. Its returning undefined
<Swiper
ref={swiper => {
this.swiper = swiper;
}}
cards={this.state.cards}
renderCard={card => {
return <Card {...card} />;
}}
onSwipedAll={() => {
console.log("onSwipedAll");
}}
cardIndex={0}
backgroundColor={"#fff"}
cardVerticalMargin={0}
cardHorizontalMargin={0}
childrenOnTop={false}
horizontalThreshold={200}
/>
Instead of this.refs.swiper try calling this.swiper
Most helpful comment
Instead of this.refs.swiper try calling this.swiper