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/testing-library/接口/RenderHookResult.md.
Lynx
  • 简体中文
    • English
  • 接口: RenderHookResult<Result, Props>

    renderHook 的返回结果

    类型参数

    类型参数
    Result
    Props

    属性

    rerender

    rerender: (props?: Props) => void

    触发一次重新渲染。props 会被传递给你的 renderHook 回调。

    参数

    参数类型
    props?Props

    返回

    void


    result

    result: object

    renderHook 回调最新返回值的稳定引用

    current

    current: Result

    renderHook 回调的返回值


    unmount

    unmount: () => void

    卸载测试组件。需要测试 useEffect 的清理逻辑时很有用。

    返回

    void

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