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 (
<View style={{marginTop:200}}>
<TouchableWithoutFeedback onPress={toggleLike}>
<Icon name='heart' type='FontAwesome' size={32} style={{color, paddingRight: 10 }}/>
</TouchableWithoutFeedback>
</View>
);