Module 6 Introduction
Introduction to module 6: The useContext Hook
Get the project source code below, and follow along with the lesson material.
Download Project Source CodeTo set up the project on your local machine, please follow the directions provided in the README.md
file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.
This lesson preview is part of the The newline Guide to Modernizing an Enterprise React App course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.
Get unlimited access to The newline Guide to Modernizing an Enterprise React App, plus 70+ \newline books, guides and courses with the \newline Pro subscription.
[00:00 - 00:16] Although it still looks the same on the surface, hardware handler is becoming a whole new application under the hood. In our last module, we rewrote some pieces of code into custom hooks that multiple components could use, and we simplified our components using them in the process.
[00:17 - 00:40] Now it's time to take a closer look at where the context API can come into play and make our code even simpler to read and understand. Prop drilling is an anti-pattern in React, but context makes that a thing of the past, and with the addition of the use context hook, we can now grab state from anywhere in our application, no matter if it's a class component or a functional component.
[00:41 - 00:55] So this module will focus on identifying where props are being passed to child components that context could handle instead, and setting up a multiple context with values and functions to support different parts of the application. Let's get to it.
[00:56 - 00:58] (clippers buzzing)