Just completed Epic React's React Hooks workshop! 🎉
Honestly? I thought I knew React Hooks.
I use them every day. useState, useEffect, useRef - they're practically muscle memory at this point. So when I started this workshop, I expected a quick revision.
The workshop didn't just recover WHAT hooks do and HOW to use them - it went deep into the WHY behind each decision and their appropriate applications. And that's where the real value was.
Here's what genuinely shifted my thinking:
- State is component-specific memory - understanding this framing made it immediately clear when to use state vs. derive a value. Always derive state when you can. Fewer sync bugs, cleaner code.
- Lazy initializers in useState - passing a function instead of a value means expensive computations only run once, on mount. A small change, meaningful performance win.
- Side-effects & the React lifecycle - Mount -> Render -> DOM update -> Layout Effects -> Paint -> Effects. Seeing the full lifecycle laid out made useEffect's behaviour click in a way it never quite had before.
- Memory leaks, explained properly - Event listener callbacks close over their scope. If you don't clean up, those closures linger in memory long after a component unmounts.
- WHY objects don't belong in dependency arrays - useEffect uses Object.is for comparison. A new render produces a new object reference, even with identical properties. Destructure and pass primitives instead.
- State update batching - dispatch doesn't immediately re-render. Updates are queued, batched per event, then applied.
- useId() for accessibility - generating stable IDs for linking labels and inputs, preventing hydration mismatches, and building truly accessible reusable components. Often overlooked, genuinely important.
First-principles understanding is what separates code you write from code you understand. This workshop is a masterclass in that approach.
A huge thank you to Kent C. Dodds - the way this course is structured around application and WHY before HOW is exactly the kind of teaching that actually sticks.
Onward to the next workshop! 🚀
#React #ReactJS #ReactHooks #Frontend #FrontendDevelopment #WebDevelopment #JavaScript #EpicReact #LearningInPublic
Good content 👌