Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

React Context for State Management

via egghead.io

Overview

In many cases, teams reach for Redux as the de facto choice for state management. But sometimes, Redux is overkill. In those cases, the React Context API might suit your needs perfectly.
In this course, we’ll build a simple email client using the React Context API to pass data throughout the app. You’ll learn how to create a context, how to pass data deeply through an app without manually passing props all over the place, and how to group related data and logic using simple wrapper components. We’ll also cover practical applications like using Context to display and manage notifications, how to maximize performance with Context, and how to test the components that use it to ensure your app is working properly.

Syllabus

  • Introduction to React Context for State Management
  • Avoid passing props deeply by using React Context
  • Pass Data With a Callback Through React Context
  • Hide the Implementation Details of a Context Provider
  • Use Multiple React Context Providers in the Same App
  • Use a React Context Consumer Outside of the Matching Provider
  • Use React Context to Display Notifications
  • Use contextType to Consume Context in a React Class Without a Consumer
  • Use the useContext Hook to Consume Context in Function Components
  • Test a Component That Uses a React Context Consumer
  • Test a Component That Uses a React Context Provider
  • Performantly Render a Large List of Items with React Context

Taught by

Dave Ceddia

Reviews

4.6 rating at egghead.io based on 829 ratings

Start your review of React Context for State Management

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.