From the course: React: Server-Side Rendering
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add Redux reducers - React.js Tutorial
From the course: React: Server-Side Rendering
Add Redux reducers
- The next step to complete Redox is to add the reducers. Basically the function that will take the action dispatch by the application and then update the store with the new information. And therefore the application will be able to update its views with the updated data. So let's go ahead and build that up. So, I'm back into the store JS file and what I'm going to do right after my actions, I'm going to create my reducers. So let's go ahead and again take a note, reducers. And, what I'm going to do is export, a Function called reducer. And I'm going to pass inside as a variable. The state with the initial state. Like so. And I'm going to pass action. And inside of that function we're going to have a switch statement. Which will pass the action type. So remember what we've done here is we have these functions or actions there are calling or dispatch from the application. And when they're called, we're returning…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Introducing Next.js with React9m 1s
-
(Locked)
Add initial components from template7m 59s
-
(Locked)
Add data for props5m 48s
-
(Locked)
Add Redux store and setup7m 1s
-
(Locked)
Add Redux actions4m 49s
-
(Locked)
Add Redux reducers7m 1s
-
(Locked)
Challenge: Why use Redux for SSR?24s
-
(Locked)
Solution: Why use Redux for SSR?48s
-
(Locked)
-
-
-