Actions in Reducers

Developed with
QA

The course is part of this learning path

ReactJS: Zero to Hero
course-steps
14
certification
7
lab-steps
3
description
1
play-arrow
Start course
Overview
DifficultyBeginner
Duration23m
Students49

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

If we have a Reducer, we need at least one Action, perhaps several. Action is usually an argument supplied to a reducer function as an object. But surprisingly, its job is to help the Reducer in deciding which execution path to follow, to create the new state. An Action object, usually has at least two properties. The type, this is generally a string of the Action is identified by and, the payload, this is the data that has been dispatched as part of the call to update the state. If we're thinking about a reducer for the filter courses table up, one of the Actions we need, is to get all of the courses. Another Action, could be to add a course when the user submits the form sending data to the server. Because there's so about course is context. We're going to put the Reducer and any other code we might need in the courses context file we created earlier. If you look on line 15, there's no any courses Reducer function. It's not complete, because we haven't identified, what we will need to do to return the new state for the Actions. But it's a start. We haven't mentioned, the use Reducer hook in React yet.

Lectures

Introduction to State Management - Context - How to Create and Provide Context - Consume Context - Reducers - The useReducer Hook - Providing Dispatch

About the Author
Students3028
Labs8
Courses29
Learning paths6

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