UNPKG

@hyper-fetch/react

Version:

React hooks and utils for the hyper-fetch

8 lines (6 loc) 260 B
import type { RenderHookResult } from "@testing-library/react"; export const getCurrentState = <T extends RenderHookResult<any, any>>( render: T, ): T extends RenderHookResult<any, infer State> ? State : never => { return render.result?.current || {}; };