Complete the code to create a state variable for the email input using React Native hooks.
const [email, [1]] = useState('');
In React Native, useState returns a pair: the current state and a function to update it. The convention is to name the updater function starting with 'set'.
Complete the code to check if the email input contains an '@' symbol for basic validation.
const isValidEmail = email.includes([1]);Checking if the email contains '@' is a simple way to validate email format.
Fix the error in the code to update the password state when the input changes.
<TextInput value={password} onChangeText=[1] />The onChangeText prop expects a function that updates the state. 'setPassword' is the correct updater function.
Fill both blanks to create a simple validation that checks if the password length is at least 8 characters.
const isPasswordValid = password.length [1] [2];
To check if password length is at least 8, use 'password.length >= 8'.
Fill all three blanks to create an object that stores validation errors for email and password.
const errors = { email: [1], password: [2], isValid: [3] };Empty strings '' mean no error messages for email and password. 'false' means the form is not valid yet.