I have used firebase for API in my React app, where it listens for the user data. When users data is updated, I am not able to listen for data changes in my React component. How to implement this functionality.
componentDidMount() {
axios.get('https://organic-kart-3f887.firebaseio.com/users.json')
.then(users => {
this.setState({
users.data
})
})
}
I am getting the user data, when the component is mounted. I am not able to listen for changes in users data in my app.