Complete the code to import the main hook from React Hook Form.
import { [1] } from 'react-hook-form';
The useForm hook is the main hook provided by React Hook Form to manage form state.
Complete the code to initialize the form methods using React Hook Form.
const { register, handleSubmit, formState: { errors } } = [1]();The useForm() hook returns methods like register, handleSubmit, and formState to manage the form.
Fix the error in the code to register a TextInput with React Hook Form.
<TextInput {...[1]('email')} placeholder="Email" />The register function connects the input to React Hook Form.
Fill both blanks to handle form submission and display an alert with form data.
const onSubmit = [1](data => { alert(JSON.stringify(data)); }); <Button title="Submit" onPress=[2] />
handleSubmit wraps the onSubmit function to process form data. The button's onPress calls onSubmit.
Fill all three blanks to create a controlled input with validation using React Hook Form's Controller.
import { Controller, useForm } from 'react-hook-form'; const { control, handleSubmit } = useForm(); <Controller control={control} name="username" rules={{ required: true }} render={({ field: { onChange, onBlur, value } }) => ( <TextInput onBlur=[1] onChangeText=[2] value=[3] placeholder="Username" /> )} />
The Controller passes onBlur, onChange, and value to the input to control it properly.