Write a Custom Hook

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • medium
  • Pro

Three components each track the window's width with their own state, effect and resize listener, copied and pasted. Explain how you'd extract a custom hook for this, and what rules hooks must follow.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →