I am new to React and I don't understand this:
I write
const [imageURL,setImageURL] = useState('');
and
var temp = "https://" + response.value.cid + ".ipfs.dweb.link/" + response.value.files[0].name;
setImageURL(temp)
console.log("Set ImageURL to: ", temp);
console.log("imageURL shows: ", imageURL);
But am obviously missing the point, because I get an empty variable imageURL
:
Would appreciate if someone could explain this to me :) Thanks!