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
I have a react hook, that relies on overloading to solve different use-cases. Essentially, this hook has an overload that determines the appropriate way to resolve a value based on its parameter typeof.
What happened:
When faced with an overloadable hook, @react-testing-library/react-hooks isn't appropriately typing either the initialProps for the renderHook method, or the rerender method itself.
Hook overloading only works when you explicitly call the hook and return it's value on the renderHook method, while when using the renderHook with the initialValue option, it doesn't properly generate the types to match the overload.
The text was updated successfully, but these errors were encountered:
@react-testing-library/react
version (if applicable): 12.1.2@react-testing-library/react-hooks
version: 7.0.2react
version: 15.4.2react-dom
version (if applicable): 15.4.2node
version:npm
(oryarn
) version:Relevant code or config:
What you did:
I have a react hook, that relies on overloading to solve different use-cases. Essentially, this hook has an overload that determines the appropriate way to resolve a value based on its parameter
typeof
.What happened:
When faced with an overloadable hook,
@react-testing-library/react-hooks
isn't appropriately typing either theinitialProps
for therenderHook
method, or thererender
method itself.Reproduction:
Reproduction
Problem description:
Hook overloading only works when you explicitly call the hook and return it's value on the
renderHook
method, while when using therenderHook
with theinitialValue
option, it doesn't properly generate the types to match the overload.The text was updated successfully, but these errors were encountered: