score:3

Accepted answer

Going to provide the answer, but if Mike Peyper posts I will mark his as the solution since he gave it to me on https://github.com/mpeyper/react-hooks-testing-library/issues/75.

To quote:

This wont work as expected as only the first argument is passed through to the hook callback. Usually you would pass an object with multiple keys and destructure it in the callback:

const { rerender } = renderHook(({ a, b, c }) => useSomeHook(a, b, c))

rerender({ a, b, c}) 

The reason for this is it's supposed to mimic the props of the wrapping component.


Related Query

More Query from same tag