Reusable State and Effects with React Hooks

Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
Star icon$$$
4.6 (202 ratings)
384 people completed
ClockIcon57m
reactReact
Elijah Manor
By

Elijah Manor

Elijah Manor is a Christian and a family man. He works at LeanKit as a senior software engineer and focuses on front-end development

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

note: React Hooks is alpha and subject to change. The React team has the 16.x roadmap here.

reactReact
Illustration for Environment Setup for React Hooks

Environment Setup for React Hooks

Elijah Manor
Lesson
ClockIcon
1:51