Custom Hooks and Reusable Logic
Write your own hooks, reuse proven recipes, subscribe to outside stores with useSyncExternalStore, and know when compound components, render props or HOCs still fit.
By now your components use state, effects, refs, context and reducers. Soon you notice the same logic in many places: the same "is the user online?" effect, the same "save this to localStorage" code, the same timer. Copying it works until you find a bug and must fix it in six files. This phase teaches the React way to share logic: custom hooks, plain functions whose names start with use and that call other hooks.
You'll extract your first hooks, build a toolbox of recipes teams use every day (useToggle, useLocalStorage, useDebounce, useOnlineStatus, useMediaQuery, usePrevious, useInterval), and learn useSyncExternalStore, the hook for reading data that lives outside React, such as browser APIs and store libraries. You'll meet the small built-in hooks (useId, useDebugValue) and take a tour of every hook React 19.2 ships, with the topic where each is taught.
Then you'll see the patterns React developers used before hooks (compound components, render props and higher-order components), why hooks replaced most of them, and where each one still fits. The phase ends with how to design a good hook: its name, its inputs, what it returns, and when not to write one at all.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.