Created
July 8, 2020 20:00
-
-
Save amorkovin/2ac5dcd8392576dbd92bf7b96b393a75 to your computer and use it in GitHub Desktop.
Firebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Получаю данные из firebase | |
componentDidMount() { | |
database.ref(this.urlRequest).once('value').then(res=>{ | |
this.setState({ | |
wordArr: res.val() || [], | |
}) | |
}) | |
} | |
// Другой метод получения данных. Он будет следить за изменениями данных. | |
componentDidMount() { | |
database.ref(this.urlRequest).on('value', res=>{ | |
this.setState({ | |
wordArr: res.val() || [], | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment