renderHook
result with vitest
and react@18
always returns null
#971
Labels
bug
Something isn't working
vitest
: 1.3.1@testing-library/react
: 14.2.1react
: 18.2.0node
: 18.16.0npm
(oryarn
): 9.5.1Relevant code or config:
useTranslations.ts
What you did:
I am trying to write test cases for this hook
useTranslations
, but I always get the result fromrenderHook
as{ current: null }
What happened:
Problem description:
I am trying to test the hook
useTranslations
, but I always get the result asnull
. I have tried adding logs into the function body ofuseTranslations
and the values are logging just as fine. The only problem is whatever I am returning I am not getting in the result key ofrenderHook
and it's always returningnull
I am using
vitest
andreact@18
and@testing-libarary/react@14
sorenderHook
is coming from the testing library.Can anyone help me identify what could be the issue here ? Thanks
The text was updated successfully, but these errors were encountered: