> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Function: useMemo()

> **useMemo**\<`T`>(`factory`: () => `T`, `deps`: `DependencyList`): `T`

`useMemo` will only recompute the memoized value when one of the `deps` has changed.

## Type Parameters

| Type Parameter |
| -------------- |
| `T`            |

## Parameters

| Parameter | Type             |
| --------- | ---------------- |
| `factory` | () => `T`        |
| `deps`    | `DependencyList` |

## Returns

`T`

## Version

16.8.0

## See

[https://react.dev/reference/react/useMemo](https://react.dev/reference/react/useMemo)
