2017-12-23 1 views

답변

0

예, 어린이의 firebase의 메서드가 추가되어 실시간 UI 업데이트를받을 수 있습니다.

updateUI() { 
dbReference.on('child_added', snap => { 
    /* 
    *here you can update your redux/react state which will directly reflect 
    *to your UI 
    */ 
    this.setState({ 
    data: snap.val().data 
    }) 
    } 
} 

render() { 
return (
    <div> 
    <span>{this.state.data.name}</span> 
    </div>) 
}