Skip to content
JS

Reusable State and Effects with React Hooks

Course on egghead by Elijah Manor

View on egghead (opens in a new tab)
57 min
LengthVideo runtime
Subscription
Price modelegghead plan
13
Lessons
4.7
Rating out of 529 ratings on egghead
Dec 2018
Published10 Dec 2018

About this course

Description from egghead

Previously, in order to add state or side-effects in React you had to create a Class Component. However, with the introduction of the Hooks proposal (currently pre-released), you can now add state and effects to a Function Component. In addition, you can extract your hook logic and create a custom hook that can be shared across your app. As I introduce the concepts of React hooks, I'll apply those concepts in various demos to see how they apply in different scenarios. I'll be converting Class Components to Function Components so you can see how they relate to each-other. By the end of this course, you'll learn how to: - Run (and Skip) side-effects with the useEffect hook - Write a custom hook to share logic in your app - Simplify the Context API with the useContext hook - Update state with dispatch actions using the useReducer hook - Optimize Components with useMemo

What it covers

13 lessons
  1. 1Introduction to Reusable State and Effects with React Hooks
  2. 2Environment Setup for React Hooks
  3. 3Add State with the useState Hook to a React Function Component
  4. 4Add Linting to Help Enforce Rules when Using React Hooks
  5. 5Add a Lifecycle Event with the useEffect Hook to a React Function Component
  6. 6Use the React useRef Hook to Reference a DOM Element or Simulate an Instance Variable
  7. 7Write Custom Hooks to Share Logic Between React Function Components
  8. 8Leverage an Existing Community Hook in Your React Function Component
  9. 9Use the useReducer Hook and Dispatch Actions to Update State
  10. 10Use the useContext Hook to Wire-up the React Context API
  11. 11Simulate PureComponent with a React Function Component
  12. 12Leverage the React useMemo Hook for Expensive Operations
  13. 13Convert a Render Props Component using a Custom React Hook

Similar React courses

  1. React Class Component Patterns

    egghead · Kent C. Dodds · 18 lessons · 4.4 from 9 ratings · Dec 2017

    56 minSubscription
    egghead184.4 (9)Dec 2017
  2. Up and running with Preact

    egghead · Shane Osbourne · 12 lessons · Jun 2017

    58 minSubscription
    egghead12Jun 2017
  3. Learn React Router v5

    Codecademy · 1 lessons · Jan 2023

    Beginner1 h
    Codecademy1Jan 2023
  4. Beginner1 h
    Codecademy2Oct 2022
  5. Beginner1 h
    Codecademy1Oct 2022
  6. Beautiful and Accessible Drag and Drop with react-beautiful-dnd

    egghead · Alex Reardon · 14 lessons · 4.8 from 30 ratings · Jul 2018

    1 h 3 minFree
    egghead144.8 (30)Jul 2018
  7. Build Your First React Website

    Coursera · Harrison Kong · Jun 2020

    Intermediate1 h 30 min
    CourseraJun 2020
  8. Intermediate1 h 30 min
    CourseraSept 2020

A hyphen means the provider's catalogue does not state the value.

Same topic, nearest in length, up to three from any one provider.

Data read from the egghead catalogue on 28 Nov 2026. How the data is collected.

    Compare