export default function CardImageExample (props) {
const [path,setpath] = React.useState("'../collections/download-0.jpg'")
function change(){
console.log(path)
if(path == "'../collections/download.jpg'"){
setpath("'../collections/download-0.jpg'")
}
else{
setpath("'../collections/download.jpg'")
}
}
return (
<View style={{alignItems: 'center'}}>
<Card style={{height: 240, width: 280, alignItems: 'center'}}>
<CardItem bordered button onPress={change}>
**<Image source={require(path)} />**
</CardItem>
</Card>
</View>
);
}
the path variable does not work but if i use the path directly it works.. Please save