You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intial props not working when rendering a hook (or I've done something wrong.) #1277
I want to confirm whether you are using renderHook from @testing-library/react-hooks (this library, up to react 17) or @testing-library/react (that library, react 18 and newer). We have a test around this case, does that pass in your environment?
@mpeyper Sorry, didn't get notified of your message for some reason. This is where we're using renderHook from.
I've not tried recently. I'll take a look at your test case. Thanks
In that case, I’ll transfer your ticket to their repo ( @testing-library/react) instead as we’re actually a different library. I hope they can get to the bottom of it for you.
We should change the naming to avoid confusion. testing-library/react-hooks passed initialProps to both which is also confusing because it's harder to reason about (especially from a type perspective).
Activity
mpeyper commentedon Jan 31, 2024
Hi @gbatterbee, is this still causing you issues?
I want to confirm whether you are using
renderHookfrom@testing-library/react-hooks(this library, up to react 17) or@testing-library/react(that library, react 18 and newer). We have a test around this case, does that pass in your environment?gbatterbee commentedon Feb 6, 2024
@mpeyper Sorry, didn't get notified of your message for some reason.

This is where we're using renderHook from.
I've not tried recently.
I'll take a look at your test case.
Thanks
gbatterbee commentedon Feb 6, 2024
This is what i get

mpeyper commentedon Feb 6, 2024
In that case, I’ll transfer your ticket to their repo ( @testing-library/react) instead as we’re actually a different library. I hope they can get to the bottom of it for you.
eps1lon commentedon Feb 7, 2024
initialPropsis for the hook, not the component.We should change the naming to avoid confusion. testing-library/react-hooks passed
initialPropsto both which is also confusing because it's harder to reason about (especially from a type perspective).