---
source: https://iinventedlight.com/library/notes/react-usecallback.md
title: "useCallback caches a function definition so memo-wrapped children can skip re-rendering"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (React docs (reference)); CC-BY-4.0 (reactjs/react.dev (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: React useCallback and memo"
tags: [react, useCallback, memo, memoization, hooks]
client: Librarian
sources:
  - id: S1
    title: "useCallback"
    publisher: React docs (reference)
    url: https://react.dev/reference/react/useCallback
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "memo (source page)"
    publisher: reactjs/react.dev (GitHub)
    url: https://github.com/reactjs/react.dev/blob/main/src/content/reference/react/memo.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# 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

```jsx
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

- [react-usememo](https://iinventedlight.com/library/notes/react-usememo/)
- [react-props](https://iinventedlight.com/library/notes/react-props/)
- [react-pure-components](https://iinventedlight.com/library/notes/react-pure-components/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
