Session Handling with Higher-Order Components

This lesson will go through Session Handling using Higher-order components.

We implemented a basic version of session handling in the previous lesson. However, the authenticated user still needs to be passed down from the App component to other components interested in using it.

This can become tedious over time because the authenticated user has to be passed through all components until it reaches all the leaf components.

Previously, we used the React Context API to pass down the Firebase instance to other components. Now, we will do the same for the authenticated user.

React Context

In a new src/components/Session/context.js file, place the following new React Context for the session (authenticated user):

Get hands-on with 1400+ tech skills courses.