Reusing Stateful Logic in React: HOC vs Render Props vs Hooks
summary
Claims that hooks win for reusing stateful React logic after a hands‑on comparison: he implements the same screen‑size feature three ways—higher‑order component, render props and a custom useScreenSize hook—showing HOCs suffer name collisions and static composition, render props create “wrapper hell,” and hooks (useState/useEffect) avoid both and return plain values. Covers five ways to reuse code, cites Redux/Apollo/Formik examples, refactors class components into hooks, and notes the hooks rule about conditional calls and Apollo’s skip option.
AI-written summary · about
chapters (10)
- 0:00Start
- 1:03Why Hooks?
- 2:08Reuse Stateless logic
- 8:02Reuse stateful logic
- 9:24Composition over inheritance
- 13:23CLINT EASTWOOD
- 13:40Higher Order Function
- 19:10HOCs Problems
- 24:37Problems?
- 33:38Reusing Logic








