• 1000 l oop prop of false, что по умолчанию, для любого может столкнуться с этой проблемой, вот что я сделал
const [cardIndex, setCardIndex] = useState(0);
// pass it to CardStack ref
const swiperRef = useRef();
const onLeftButtonClick = () => {
if(cardIndex > 0) {
setCardIndex(cardIndex - 1);
swiperRef.current.goBackFromRight();
}
}
const onRightButtonClick = () => {
// data used to render cards
if(cardIndex < data.length - 1) {
setCardIndex(cardIndex + 1);
swiperRef.current.swipeLeft();
}
}