import { cleanup, act, RenderOptions, RenderResult } from 'react-testing-library'

export function renderHook<P, R>(
  callback: (...args: [P]) => R,
  options?: {
    initialProps?: P
  } & RenderOptions
): {
  readonly result: {
    current: R
  }
  readonly unmount: RenderResult['unmount']
  readonly rerender: (hookProps?: P) => void
}

export const testHook: typeof renderHook

export { cleanup, act }

import { cleanup, act, RenderOptions, RenderResult } from 'react-testing-library'

export function renderHook<P, R>(
  callback: (props: P) => R,
  options?: {
    initialProps?: P
  } & RenderOptions
): {
  readonly result: {
    current: R
  }
  readonly unmount: RenderResult['unmount']
  readonly rerender: (hookProps?: P) => void
}

export const testHook: typeof renderHook

export { cleanup, act }

Simplify the way to extract first argument type
Simplify the way to extract first argument type

Co-Authored-By: otofu-square <e95cb21d94d4e529b52e109b5e5dd4ff341d966e@gmail.com>