Skip to content
JS

Shareable Custom Hooks in React

Course on egghead by Joe Previte

View on egghead (opens in a new tab)
30 min
LengthVideo runtime
Subscription
Price modelegghead plan
8
Lessons
4.6
Rating out of 545 ratings on egghead
Oct 2019
Published29 Oct 2019

About this course

Description from egghead

React 16.8 introduced Hooks like useState for using stateful logic in our function components, and useEffect for side effects previously only used in class-based components. The React Team has given developers a way that simplifies using core features, but what's that mean for the code that you write? In this self-paced workshop, you'll work through refactoring a component to use a custom hook, and learn to apply the patterns used by the React team to your own code. Follow the React Team's lead, and make your code more readable, reusable, and reasonable!

What it covers

8 lessons
  1. 1Change a Stateful React Class Component to a Function Component with the State Hook
  2. 2Use the React Effect Hook in Function Components
  3. 3Write a Custom State Hook in React
  4. 4Write a Custom React Effect Hook
  5. 5Extract a Custom Hook into its own Module with create-react-hook
  6. 6Test your Custom Hook Module with react-hooks-testing-library
  7. 7Prepare a Custom React Hook to be Published as an npm Package
  8. 8Publish a Custom React Hook as an npm Package

Similar React courses

  1. VR Applications using React 360

    egghead · Tomasz Łakomy · 14 lessons · 4.3 from 1 ratings · Jun 2019

    30 minSubscription
    egghead144.3 (1)Jun 2019
  2. Scalable Offline-Ready GraphQL Applications with AWS AppSync & React

    egghead · nader dabit · 9 lessons · 4.0 from 6 ratings · Nov 2018

    32 minFree
    egghead94.0 (6)Nov 2018
  3. Building Serverless Web Applications with React & AWS Amplify

    egghead · nader dabit · 8 lessons · 4.3 from 14 ratings · Feb 2019

    34 minSubscription
    egghead84.3 (14)Feb 2019
  4. Learn React Router v5

    Codecademy · 1 lessons · Jan 2023

    Beginner1 h
    Codecademy1Jan 2023
  5. Beginner1 h
    Codecademy2Oct 2022
  6. Beginner1 h
    Codecademy1Oct 2022
  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