I wanna test a custom hook with react-testing-library
therefore, I add this code into beforeEach:
let renderedHook ;
beforeEach(() => {
renderedHook = renderHook(() => useFetch());
});
test('.....', () => {
expect(renderedHook.current.data).toBe(1);
});
the above code works well! but I'm using TypeScript, what's the suitable type for let renderedHook
in this case?