Search across all documentation pages
17 pages in this section.
Step-by-step React custom hooks guide - naming conventions, dependency arrays, return shapes, testing, and extracting reusable stateful logic.
Two complementary hooks: useDebouncedValue delays a reactive value; useDebouncedCallback delays a function call.
Rate-limit how often a fast-changing value or callback updates using the useThrottle custom hook. Control updates during scroll, resize, or mouse-move events.
Implement a "back to top" button with useScrollToTop. Learn to show the button after a scroll threshold and smoothly scroll to the top.
Persist and synchronize component state across browser tabs and refreshes using the useLocalStorage custom hook. Learn how to implement it.
Use the useMediaQuery hook to subscribe to CSS media query matches in JavaScript. Learn to conditionally render components and load data based on screen size or user
Detect clicks outside a referenced element to dismiss UI components like dropdowns, modals, and popovers. Learn to implement this custom hook.
Copy text to the clipboard with success and error feedback for copy buttons on code, API keys, and share links.
Detect when an element enters or exits the viewport using the useIntersectionObserver hook. Learn to implement lazy loading, infinite scroll, and animate-on-scroll effects.
Track the window's width and height in JavaScript for responsive layout, canvas sizing, and virtualized lists.
Register keyboard shortcuts in your React components using the useKeyboardShortcut hook. Learn to bind keys like Ctrl+K with modifier support.
Track the previous value of any state or prop with usePrevious. Learn to detect changes, trigger animations, or skip redundant effects.
Learn to use the useFetch custom hook for data fetching in React, including handling loading states, errors, refetching, and aborting requests.
Learn to use the useInterval custom hook for declarative setInterval in React, with features like pause/resume and dynamic delay.
Attach window, document, or element event listeners with automatic cleanup, fresh callbacks, and type-safe event types.
A single-page roundup of every highlight bullet from the 16 pages in the Custom Hooks section, grouped by source page so you can scan all 96 takeaways without opening each article individually.