Working on this project and trying to call firebase real-time database information then setting a state after calling it so I can use it in the render. This is my code currently but its saying setState is unknown, I've tried to read up on other solutions to this problem but don't understand it, any help would be appreciated. Thanks.
componentDidMount(){
this._getLocationAsync();
firebase.database().ref('pets/').once('value', function (snapshot) {
this.setState({ testdid: snapshot.val().name })
});
}