Hi
i am using like button in flatlist.but if i click one post like button.then all like button will change.Is there any option for change selected post like button only
const App = ({item, index}) => {
const [like, setLike] = useState({});
const [color, setColor] = useState("green");
const toggleLike = () => {
setLike(!like)
if(like) {
setColor("red");
} else {
setColor("green");
}
}
return (
);
}
Replies
Know the answer? Post it — somebody with the same question will find it here.