illustration for Reusable State and Effects with React Hooks

Reusable State and Effects with React Hooks

Instructor

Elijah Manor
57m closed-captioning
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
4.6
1019
people completed
Bookmark
Download
RSS

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, 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

Learner Reviews

  • Marcell Ciszek
    4 years ago
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Well explained and fantastic content, really appreciated this tutorial.

  • Scott
    4 years ago
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What would make this course a 7 for you?

    I really like the way Elijah describes what he's going to do. I like little things like the way he writes out the conditions for update in hooks before going into the callback details. I like a lot of what he's done here, including his examples and the continuity in how he explains things the same way each time.

    Like most videos on a specific piece of technology, it moves a little fast at times and doesn't fully explain the 'why' before the 'how.' Often, these videos will say "lets update this to do this other thing" but don't explain why someone would do that. It's hard to understand the value, let alone the method if the purpose is unclear. The purpose gives the method a lot of context. At least it does for me.

  • Lucidea
    5 years ago
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    How will you use what you learned from this course?

    Thanks. I understand more about hooks. It just opened cool possibilities of the next React development.

  • Niv B
    5 years ago
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Great ready examples, clear explanation, go through the foundations and add more to make you a better react developer

  • Mimi Nguyen
    5 years ago
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What did you like about this course?

    Everything is very well explained. I love the way when the teacher explains everything while modifying the code. Just can say, I like more and more lessons like this. Thank you so much.

  • SolidLogix
    5 years ago
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    Star icon$$$
    What was your strongest take away from this course?

    It would be great to share the initial code base per each lecture.

Course Content

57m • 13 lessons

    You might also like these resources:

    illustration for Introduction to Cloudflare Workers

    Introduction to Cloudflare Workers

    Kristian Freeman・36m・Course

    Become familiar with the Workers CLI wrangler that we will use to bootstrap our Worker project. From there you'll understand how a Worker receives and returns requests/Responses. We will also build this serverless function locally for development and deploy it to a custom domain.

    illustration for Create an eCommerce Store with Next.js and Stripe Checkout

    Create an eCommerce Store with Next.js and Stripe Checkout

    Colby Fayock・1h 4m・Course

    This is a practical project based look at building a working e-commerce store using modern tools and APIs. Excellent for a weekend side-project for your developer project portfolio

    illustration for Practical Git for Everyday Professional Use

    Practical Git for Everyday Professional Use

    Trevor Miller・1h・Course

    git is a critical component in the modern web developers tool box. This course is a solid introduction and goes beyond the basics with some more advanced git commands you are sure to find useful.