简体   繁体   中英

How can I find a value of a state variable in React js when data is retrieved from Firebase database

I have happily managed to set my state variable named walletData with data from Firebase. Now I have a stupid problem that I can't get the value out, for example

let someNumber = this.state.walletData.walletSaldo

Console.log displays {saldo: 1500}. Firebase tree looks like this. enter image description here

Did you try this?

this.state.walletData.walletSaldo.saldo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM