React - State Management

Developed with
QA

The course is part of this learning path

ReactJS: Zero to Hero
course-steps
14
certification
5
lab-steps
3
description
1
play-arrow
Introduction to State Management
Overview
DifficultyBeginner
Duration23m
Students31

Description

This module looks at how to manage state in React. You’ll be looking at state management, context, and reducers.  

Learning Objectives 

The objectives of this module are to provide you with an understanding of: 

  • State Management  
  • Context  
  • How to create and provide context  
  • Reducers  
  • How to provide dispatch 

Intended Audience  

This learning path is aimed at all who wish to learn how to use the ReactJS framework.  

Prerequisites

It is essential you understand the face of contemporary web development to attend this course. We insist upon JavaScript experience, along with good HTML and CSS skills. 

Feedback 

We welcome all feedback and suggestions - please contact us at qa.elearningadmin@qa.com to let us know what you think. 

Transcript

Over time, you'll hopefully create your own library of React components that can be used across a number of different applications. As these applications become more complex, identifying what state each should live, can become a difficult job. It must fully complex hierarchical component trees, that may have many branches that are many levels deep. Sharing a single source of truth across the branches by passing props through the tree, can add a lot of additional code and makes the components less easy to understand. The React community has been well aware of this issue, and different methodologies to abstract the state management have been introduced to work with state and complex component trees. In this section, we'll examine what context is, and how the useContext hook can be utilized to help simplify these data drill-downs. We'll also examine reducers and how the useReducer hook is leveraged to enable components to dispatch actions and payloads to keep state updated. You may have heard of Redux, as a state management tool commonly used with React. And that's one way to do it. But the one with hooks has introduced much of the functionality into React and that's great news. So we won't be looking into Redux here.

Lectures

Context - How to Create and Provide Context - Consume Context - Reducers - Actions in Reducers - The useReducer Hook - Providing Dispatch

About the Author

Students1742
Labs8
Courses29
Learning paths5

An outstanding trainer in software development with more than 15 years experience as a Corporate and Apprentice Trainer, ICT Teacher and Head of Department, with a passion for technology and its uses. Continuing to develop existing and new skills and courses, primarily in web design using PHP, JavaScript, HTML, CSS and SQL but also OOP (Java), programming foundations (Using Python), DevOps (Git, CI/CD, etc) and Agile/Scrum. Practically minded, a quick learner and a problem solver with an attention to detail to ensure high quality outcomes.

Covered Topics