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/Interfaces/RenderHookResult.md.
Lynx
  • 简体中文
  • Interface: RenderHookResult<Result, Props>

    renderHook 的返回结果

    Type Parameters

    Type Parameter
    Result
    Props

    Properties

    rerender

    rerender: (props?: Props) => void

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

    Parameters

    ParameterType
    props?Props

    Returns

    void


    result

    result: object

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

    current

    current: Result

    renderHook 回调的返回值


    unmount

    unmount: () => void

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

    Returns

    void

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