Firebase Real Time Database JavaScript

componentDidMount(){
   // To Fetch Child Data in JavaScript
    if(!firebase.apps.length){
    
      firebase.initializeApp(config); 
    }
      const user = firebase.auth().currentUser;
      //To Replace Email dot with Comma
      var NewText = user.email.replace(".", ",");
                if (user) {
           firebase.database().ref('Patient_Appointments/'+NewText).on('value',datasnap=>{
 
              if(datasnap.val()){
       
             console.log()
             this.setState({myList:Object.values(datasnap.val())})
    
  
            }
          }
        ) 
      }    
    } 
Talented Thrush