useCallback caches a function definition so memo-wrapped children can skip re-rendering
Answer: useCallback(fn, dependencies) is a React Hook that lets you cache a function definition between re-renders. It matters mainly when you pass the function as a prop to a component wrapped in memo, which lets you skip re-rendering a component when its props are unchanged.
Example
import { memo, useCallback } from 'react';
const ShippingForm = memo(function ShippingForm({ onSubmit }) { /* ... */ });
function ProductPage({ productId, referrer }) {
const handleSubmit = useCallback((orderDetails) => {
post('/product/' + productId + '/buy', { referrer, orderDetails });
}, [productId, referrer]);
return <ShippingForm onSubmit={handleSubmit} />;
}
useCallback versus useMemo
The difference is in what they let you cache: useMemo caches the result of calling your function, while useCallback caches the function itself.
When it is worth it
useCallback is only valuable in a few cases: passing the function as a prop to a component wrapped in memo, or the function is used as a dependency of another Hook. If most interactions are granular, like moving shapes in a drawing editor, memoization can be very helpful.
How memo compares props
memo returns a new React component. By default, React will compare each prop with Object.is. You can pass an optional arePropsEqual function, but usually you will not specify it.
See also
Claims
- id: C1 claim: useCallback caches a function definition between re-renders. source: S1 evidence: "lets you cache a function definition between re-renders"
- id: C2 claim: useMemo caches the result of calling the function. source: S1 evidence: "useMemo caches the result of calling your function."
- id: C3 claim: memo skips re-rendering when props are unchanged. source: S2 evidence: "lets you skip re-rendering a component when its props are unchanged"
- id: C4 claim: memo compares each prop with Object.is by default. source: S2 evidence: "By default, React will compare each prop with"
Sources
- [S1] useCallback. React docs (reference). https://react.dev/reference/react/useCallback . License: CC-BY-4.0. Accessed 2026-11-18.
- [S2] memo (source page). reactjs/react.dev (GitHub). https://github.com/reactjs/react.dev/blob/main/src/content/reference/react/memo.md . License: CC-BY-4.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: React docs (reference), useCallback; reactjs/react.dev (GitHub), memo (source page). CC-BY-4.0 (https://raw.githubusercontent.com/reactjs/react.dev/main/LICENSE-DOCS.md). Copyright Meta Platforms, Inc. and affiliates. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: React docs (reference), useCallback; reactjs/react.dev (GitHub), memo (source page). CC-BY-4.0 (https://raw.githubusercontent.com/reactjs/react.dev/main/LICENSE-DOCS.md). Copyright Meta Platforms, Inc. and affiliates.
Cite this
iinventedlight. 2026. "useCallback caches a function definition so memo-wrapped children can skip re-rendering." iinventedlight Library, iil:note:ayrqqmkb, version of 2026-11-18. https://iinventedlight.com/library/notes/react-usecallback/. License: CC-BY-4.0.
@misc{iil_note_ayrqqmkb,
author = {{iinventedlight}},
title = {{useCallback caches a function definition so memo-wrapped children can skip re-rendering}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/react-usecallback/},
note = {Permanent ID iil:note:ayrqqmkb. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/react-usecallback.md.