Exercise 2: Firebase in React!
Explore how to set up Firebase in a React application by creating a context that manages Firebase instances. Understand environment configuration and prepare your app for backend communication through authentication and database integration.
We'll cover the following...
We'll cover the following...
Project
import React from 'react';
const Account = () => (
<div>
<h1>Account</h1>
</div>
);
export default Account;
While there are no changes on the front-end of the application, a new context.js has been created in src/components/Firebase. This will allow us to create Firebase instances whenever needed.
Exercise
- Confirm your source code for this section.
Reading Task
- Read more about React’s Context API.
In the next section, we will implement the interface for the Firebase class on our side in order to communicate with the Firebase API.