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, and this page is available as Markdown at /next/zh/api/react/Hooks/useDebugValue.md.
  • 简体中文
  • 函数: useDebugValue()

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

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

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

    类型参数

    类型参数
    T

    参数

    参数类型
    valueT
    format?(value: T) => any

    返回

    void

    Version

    16.8.0

    参阅

    https://react.dev/reference/react/useDebugValue

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。