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

# Function: useDebugValue()

> **useDebugValue**\<`T`>(`value`: `T`, `format?`: (`value`: `T`) => `any`): `void`

`useDebugValue` 可用于在 React DevTools 中为自定义 Hook 显示一个标签。

注意：我们不建议为每一个自定义 Hook 都添加调试值。
它对属于共享库一部分的自定义 Hook 最有价值。

## Type Parameters

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

## Parameters

| Parameter | Type                    |
| --------- | ----------------------- |
| `value`   | `T`                     |
| `format?` | (`value`: `T`) => `any` |

## Returns

`void`

## Version

16.8.0

## See

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