I have dummy data for UI testing as belows
let sampleData = [
{
name : "Banana",
isFurit : true,
volume: 0,
},
{
name : "book",
isFurit : false,
volume: 0,
},
{
name : "melon",
isFurit : true,
volume: 0,
},
]
I want to change ‘isFruit’ value when I press button. but it doesn’t work.
{sampleData.map((data, index) => {
const {name,isFruit,volume} = data
return (
.
.
<TouchableOpacity onPress={(isFruit) => (!isFruit)} style={{marginLeft: 5}}>