We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code returns a typescript error
import { renderHook } from '@testing-library/react-native' import { useMyHook } from '../hooks' describe('useMyHook', () => { it('should pass', () => { const { result, rerender } = renderHook((num: number) => useMyHook(num), { initialProps: undefined }) expect(result.current).toBeUndefined() rerender('granted') //Error here, props type is undefined expect(result.current).toBe('granted') }) })
For it to work fine I have to to do
const { result, rerender } = renderHook<number, number>((num: number) => useMyHook(num), { initialProps: undefined })
this doesn't happen when using
import { renderHook } from '@testing-library/react-hooks'
Not having a typescript error and instead pull the prop types correctly.
See description.
npmPackages: @testing-library/react-native: 12.1.2 => 12.1.2 react: 18.1.0 => 18.1.0 react-native: 0.70.9 => 0.70.9 react-test-renderer: 18.1.0 => 18.1.0
The text was updated successfully, but these errors were encountered:
Hello @rarenatoe, thanks for submitting the issue! I have opened a pr #1421 to fix it
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
The following code returns a typescript error
For it to work fine I have to to do
this doesn't happen when using
Expected behavior
Not having a typescript error and instead pull the prop types correctly.
Steps to Reproduce
See description.
Screenshots
Versions
The text was updated successfully, but these errors were encountered: