React's Future - Under the Hook
summary
Rebuilds a time‑tracking app with React 16.8 hooks, showing concrete code: uses useState/useEffect/useMemo/useRef to replace class state and lifecycle, demos a toy implementation of useState to explain hook ordering, surfaces the stale state pitfall from effect closures and fixes it with a ref, extracts a custom useInterval hook for reuse, and runs the refactored app live so the interval logic and fixes actually work.
AI-written summary · about
chapters (18)
- 0:00Intro
- 2:33Demo
- 4:45State
- 6:15How does it work
- 7:00Lets build it ourselves
- 11:20React State
- 12:30Refactor Home Component
- 13:29Set Items
- 14:40Separation of Concern
- 15:54Computed State
- 18:19Computed Property
- 21:38Use Cases
- 23:03Use Effects
- 25:17Repassing
- 27:02Testing
- 30:00Intervals
- 32:31Hooks
- 37:26Custom Hooks








