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 }

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 }

--- 
+++ 
@@ -1,7 +1,7 @@
 import { cleanup, act, RenderOptions, RenderResult } from 'react-testing-library'
 
 export function renderHook<P, R>(
-  callback: (...args: [P]) => R,
+  callback: (props: P) => R,
   options?: {
     initialProps?: P
   } & RenderOptions
Simplify the way to extract first argument type

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