In this video, Emmanuel Henri implements the Firebase call to read from the Firebase database that is connected in the previous video. Then he updates the state with the data received from the Firebase database.
- [Narrator] Now that we have a database ready…for us to pull data from,…let's go ahead and connect it to our React application.…So what I want you to do, if you don't have it open,…click on App.js, and then inside of the componentWillMount,…go ahead and return right after the semicolon here.…And what we'll do here,…because we already initialized the app,…so right now we're connected to firebase…but we're not pulling any data from firebase.…So what we'll do next is use a function called…database from firebase…and then what we're doing is referencing the database…that we're connecting to.…
So sometimes if you have a user that your passing…if you need to log in first,…it would pass to value here,…so for example we would create a variable of user…and then from firebase we would initialize the user.…And then pass that on here with a template strings…like we're doing here.…So it would be something like, for example,…user here the value that we've created,…or initialized from the firebase database.…
But we don't need that because we just simply created…
Released
10/10/2017- Creating a new React project
- Installing and working with React Developer Tools
- Dissecting a project into components
- Setting up the state with static data
- Adding and finalizing CSS in components
- Setting up and leveraging Firebase
- Standard code best practices
- Installing and setting up Flow for type checking
Share this video
Embed this video
Video: Connect read functions