react-usecallback

Installation
SKILL.md

React useCallback

Overview

useCallback memoizes function references between renders. In 2026 with React Compiler, manual useCallback is rarely needed — the compiler auto-memoizes. Without the compiler, useCallback only helps when paired with memo() on the child component.

With React Compiler (2025+)

React Compiler 1.0 (Oct 2025) auto-applies memoization at build time. Don't add new useCallback — the compiler handles it better. If memoization is unnecessary, the compiler omits it from output.

Exceptions where manual useCallback is still needed:

  • External libraries not compiled by React Compiler (older react-hook-form, animation libs)
  • Functions used as useEffect dependencies that can't be moved inside the effect
  • Custom hooks exporting functions — wrap in useCallback for stable references
  • Measured performance issues the compiler doesn't fix

Without React Compiler

useCallback only makes sense together with memo() on the child component.

Related skills

More from b4r7x/agent-skills

Installs
15
First Seen
Mar 11, 2026