🎁

12 Days of Baddass Courses sale! Get instant access to the entire egghead library of courses and lessons for 58% off.

Runs out in:
13 : 08 : 54 : 30
1×
Become a member
to unlock all features
Autoplay

    Introduction to Reusable State and Effects with React Hooks

    Elijah ManorElijah Manor
    reactReact

    In this course we start by getting your environment setup for hooks and then we’ll introduce the idea of adding state to a function component and unpacking several ways to interact with that state.

    There are a few rules that you need to follow when you start using hooks, but thankfully there's a custom ESLint plugin that’ll help enforce these rules. I’ll show how to setup the hooks plugin and talk about some of the rules that should be followed.

    Things get more interesting and involved once we introduce side-effects to our function component with the useEffect hook. We’ll uncover numerous things to consider while using this particular hook.

    One of the cool features of hooks is that it’s easy to abstract out code for reuse with custom hooks. The React community has already created lots of custom hooks that you can start playing with today.

    Once I've introduced the main concepts of useState and useEffect, I'll start to unpack other hooks such as useRef, useReducer, useContext, useMemo, and useCallback.

    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss