Blog

Building Your Own Custom Hooks in React
You write a component that tracks window width with useState, useEffect, and a resize listener. A week later you need the same thing in another c
Continue Reading
useMemo and useCallback: When Memoization Actually Helps
Open almost any React codebase and you'll find useMemo and useCallback wrapped around things that don't need them: a string concatenation, an inl
Continue Reading
Mastering useRef: Beyond Accessing DOM Elements
Most developers meet useRef as "the hook for focusing an input." You attach it to an element, call ref.current.focus(), and move on. That's a fin
Continue Reading
Why Your useEffect Runs Twice in React Strict Mode
You add a console.log inside useEffect, open the browser, and see it printed twice. Your API request shows up twice in the Network tab. An analyt
Continue Reading
A Practical Guide to useEffect and Its Dependency Array
useEffect is the hook people get wrong most often, and the dependency array is usually where it goes wrong. Leave a value out and your effect works
Continue Reading
useState vs useReducer: Choosing the Right State Hook
Every React component that remembers something uses either useState or useReducer. Most of the time useState is the obvious pick: a boolean for
Continue Reading