import React, { useState } from 'react'; import TinderCard from 'react-tinder-card'; import './Tinder.css'; const Tinder = (props) => { const route = props.getValue; const cardInfo = props.cardInfo; const [lastDirection, setLastDirection] = useState(); const [cardId, setCardId] = useState([]); const [allIds, setAllIds] = useState([]); const swiped = (direction, id) => { setLastDirection(direction); allIds.push(id); console.log(allIds.length); if (direction === 'right' || direction === 'up') { cardId.push(id); }; }; const handleDislike = (id) => { console.log('left'); swiped('left', id); }; const handleLike = (id) => { console.log('right'); swiped('right', id); }; return (