Skip to content
WebDev Path
Back

Week 12: Effects, data fetching and custom hooks

Next video

WebDev Path video lesson

About this lesson

Module:
React
Time:
about 11 hours
Video:
2 min

Load data in React and reuse logic with your own hooks.

By the end of this week you can

  • Know when you need useEffect and when you don't
  • Fetch data with loading and error states
  • Write a custom hook

Learn

  • useEffect and cleanup
  • Fetching in React
  • Custom hooks
  • Common effect mistakes

Read or watch

Practice

  1. Rewrite Project 2 in React
  2. Extract a useFetch hook

Build

Movie or recipe browser in React.

Check your understanding

Score 4 out of 5 to complete this week.

  1. 1. What is useEffect for?
  2. 2. What does an empty dependency array [] mean?
  3. 3. Why return a cleanup function from an effect?
  4. 4. What is a custom hook?
  5. 5. What is the common bug when fetching in an effect without handling it?
0 of 5 answered