In my app I want the user name to be displayed after user logins for that i have used the Uid but I am not recieving data from firebase
Using RN>57.8
this is my code:
componentDidMount(){
firebase.database()
.ref('users/'+this.state.uid)
.on('value',(snapshot)=>{
const name1 = snapshot.val().name;
alert(name1)
})
}
and
componentDidMount(){
firebase.database()
.ref(`users/${this.state.uid}`)
.on('value',(snapshot)=>{
const name1 = snapshot.val().name;
alert(name1)
})
}
I want to show alert message with the name of the user but it is not working whereas if i write the path directly as shown below i am able to get the alert
Example:
.ref('users/ALM5456N3NNN35HFR56L')