Complete the code to create a state variable for the email input.
const [email, [1]] = useState('');
The useState hook returns a pair: the current state value and a function to update it. The convention is to name the updater as set + state name.
Complete the code to handle email input change in a TextInput component.
<TextInput value={email} onChangeText=[1] />The onChangeText prop expects a function that receives the new text and updates the state. Passing setEmail directly works because it matches that signature.
Fix the error in the sign-in function to correctly await the Firebase email sign-in method.
async function signIn() {
try {
const user = [1] auth().signInWithEmailAndPassword(email, password);
console.log('User signed in:', user);
} catch (error) {
console.error(error);
}
}The signInWithEmailAndPassword method returns a promise. To get the user object, you must await the promise inside an async function.
Fill both blanks to correctly import and use the Google Sign-In button component.
import { [1] } from '@react-native-google-signin/google-signin'; function GoogleButton() { return <[2] onPress={handleGoogleSignIn} />; }
The correct component name exported by the package is GoogleSigninButton. It is imported and used with the exact same name.
Fill all three blanks to correctly configure Apple authentication button with required props.
import AppleAuthentication from '@invertase/react-native-apple-authentication'; function AppleSignIn() { return ( <AppleAuthentication.AppleButton buttonType=[1] buttonStyle=[2] onPress=[3] /> ); }
The AppleButton requires a buttonType and buttonStyle from AppleButtonType and AppleButtonStyle enums, and an onPress handler function.