React Custom Hooks
summary
Claims that hooks let components be pure functions, reuse stateful logic with useState/useEffect/useContext, and run faster than classes. Demonstrates a custom screen-size hook: naive version attaches listeners per component and renders thousands of boxes in 8.7 seconds; refactor using a context provider drops that to 16.3 ms for 4,000 boxes. Points to a GitHub repo and an open source u5 library of hooks and components and shows the optimized code works.
AI-written summary · about
chapters (15)
- 0:00Intro
- 1:28History
- 2:35Reuse of State
- 3:50Hooks
- 7:04State
- 8:28State Optimization
- 9:55Use Effect
- 12:26Rules for hooks
- 14:23What is customhook
- 16:20Screen Size
- 20:33Component Box
- 21:29Cleanup
- 22:17UseContext
- 24:21Custom Hooks
- 25:35Conclusions
related talks
17mReact hooks: the good, the bad and the ugly
45mWhy I am hooked on the future of React
22mI Am Hooked on React
56mWith great power comes great React hooks!
27mEric Bishard - State Management with React Hooks
38mReact UI: get hooked!
36mReusing Stateful Logic in React: HOC vs Render Props vs Hooks
27museEncapsulation: Using React Hooks Sensibly
