samedi 12 août 2017

React Variable value is not changing

i'm trying to do something in react and i got stuck .. i don't know why this is happening, i can't explain myself.

let content = null;
        storage.ref().child(snapshot.val().content).getDownloadURL().then(url => content = url ); // setting value

        console.log('content', content); // returns initial value, in my case, null. why?

Line 19

http://ift.tt/2fAfrQN

Thanks!




Aucun commentaire:

Enregistrer un commentaire