Describe the bug
I get TypeError: (0 , _reactNative.renderHook) is not a function error.
Expected behavior
renderHook should be a function and work properly
Steps to Reproduce
This is what my Signin.test.js file contains:
import React from 'react';
import { useFormik } from 'formik';
import { render, fireEvent, renderHook } from '@testing-library/react-native';
import Signin from '../../../../src/modules/auth/components/Signin';
import CustomIntlProvider from '../../../__helpers__/CustomIntlProvider';
describe('Signin screen component', () => {
test('signup function is called when the button is pressed', () => {
const formik = renderHook(() =>
useFormik({
initialValues: { email: '', password: '' },
onSubmit: jest.fn(),
validateOnChange: false,
validateOnBlur: false,
}),
);
const signUp = jest.fn();
const forgotPassword = jest.fn();
const { getByText } = render(<Signin formik={formik} signUp={signUp} forgotPassword={forgotPassword} />, {
wrapper: CustomIntlProvider,
});
expect(signUp).toHaveBeenCalledTimes(0);
fireEvent.press(getByText('btn.signup'));
expect(signUp).toHaveBeenCalledTimes(1);
});
});
Screenshots

Versions
@testing-library/react-native: ^9.1.0 => 9.1.0
react: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-test-renderer: 17.0.2 => 17.0.2
Describe the bug
I get
TypeError: (0 , _reactNative.renderHook) is not a functionerror.Expected behavior
renderHookshould be a function and work properlySteps to Reproduce
This is what my
Signin.test.jsfile contains:Screenshots
Versions