Using React Hooks

React Hooks bring state and lifecycle events to React Functional Components as well as streamlining code that previously was coupled and complex. Learn techniques for using React Hooks including Redux-like state management with React Context.
Course info
Rating
(195)
Level
Beginner
Updated
Aug 11, 2020
Duration
2h 43m
Table of contents
Course Overview
Start Using React Hooks with useState, useEffect, and useRef
Using More Hooks: useContext, useReducer, useCallback, and useMemo
Migrating Your Existing Apps to React Hooks
Learn How to Combine Existing React Hooks into New Combined Hooks
Using useContext and useReducer to Make a Redux-like Global State
Description
Course info
Rating
(195)
Level
Beginner
Updated
Aug 11, 2020
Duration
2h 43m
Description

React Hooks reduce the complexity associated with managing state and lifecycle events exclusively in React Functional Components. What previously was complex, and often required middleware to implement, can be easily done and extended using React Hooks. They are called “hooks” because they allow the developer to hook into existing pre-built functionality. In this course, Using React Hooks, you'll gain the ability to consume pre-built React Hooks, as well as author your own custom React Hooks. First, you’ll learn all about the six most commonly used React Hooks that are built into the React core library. Then, you’ll see how they compare to the corresponding state and lifecycle events in more traditional legacy React Class Components. Next, you’ll explore how to both consume and author your own re-usable custom React Hooks. Finally, you’ll be shown how to combine React Context with React Hooks state management to integrate a Redux-like state management solution into your React app. When you are finished with this course, you’ll confidently be able to build fully capable functional components that use React Hooks.

About the author
About the author

Peter is the founder of Silicon Valley Code Camp and long-time software professional specializing in mobile and web technologies. He has also been a Microsoft MVP in ASP.NET since 2006.

More from the author
Designing React Components
Intermediate
2h 43m
May 29, 2020
ASP.NET Core Tag Helpers and View Components
Intermediate
3h 1m
Aug 23, 2019
More courses by Peter Kellner
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi. I'm Peter Kellner, and welcome to my course, Using React Hooks. I'm a part‑time docs writer for Microsoft, part‑time author, part‑time conference organizer, and full‑time learner. React Hooks represents a huge step forward towards building a fully functional React app with minimal use of class components. Let me convince you that React Hooks, based off of functional components, are the best way to build React apps. Managing state and lifecycle events with Hooks is much easier, requires less code, and is much more readable than doing the same with React class components. Hooks are how JavaScript was always meant to be programmed. The major topics that we will cover include built‑in React Hooks, including useState, useRef, and useEffect, advanced Hooks like useReducer and useContext, we'll compare how React Hooks in functional components replace more complex code in class components, and finally, we'll build a real‑world React app using Hooks that includes a custom React Hook designed to handle CRUD operations running against a REST server. By the end of this course, you'll completely understand how to, using React Hooks, make your React functional components work with state and component lifecycle events in your apps. You'll be able to build an entire React app with just functional components and React Hooks, no class components needed. This is not a beginner course on React itself. If you are not comfortable building simple React apps that use state, I suggest you start out with the React: Getting Started or React Fundamentals course, and then take this one after. Join me and learn how you can use React Hooks in all your apps by watching this course, Using React Hooks, at Pluralsight.