Complete the code to import KeyboardAvoidingView from React Native.
import { View, TextInput, [1] } from 'react-native';
The KeyboardAvoidingView component is imported from 'react-native' to help adjust the UI when the keyboard appears.
Complete the code to wrap the TextInput with KeyboardAvoidingView.
return ( <[1] behavior="padding" style={{ flex: 1 }}> <TextInput placeholder="Type here" /> </[1]> );
The KeyboardAvoidingView wraps the input to move it above the keyboard when it appears.
Fix the error in the KeyboardAvoidingView behavior prop to use the correct value for iOS.
<KeyboardAvoidingView behavior=[1] style={{ flex: 1 }}> <TextInput placeholder="Enter text" /> </KeyboardAvoidingView>
On iOS, the recommended behavior prop value is "padding" to move content above the keyboard.
Fill both blanks to set KeyboardAvoidingView to adjust only on iOS and use the correct keyboardVerticalOffset.
const isIOS = Platform.OS === 'ios'; return ( <KeyboardAvoidingView behavior=[1] keyboardVerticalOffset=[2] style={{ flex: 1 }}> <TextInput placeholder="Input" /> </KeyboardAvoidingView> );
On iOS, behavior is set to "padding" and keyboardVerticalOffset is often set to 64 to offset the keyboard height properly.
Fill all three blanks to create a KeyboardAvoidingView that only adjusts on iOS, uses a vertical offset, and contains a TextInput with a placeholder.
import React from 'react'; import { KeyboardAvoidingView, TextInput, Platform } from 'react-native'; export default function App() { return ( <KeyboardAvoidingView behavior=[1] keyboardVerticalOffset=[2] style={{ flex: 1 }}> <TextInput placeholder=[3] style={{ height: 40, borderColor: 'gray', borderWidth: 1 }} /> </KeyboardAvoidingView> ); }
This code sets behavior to "padding" for iOS, uses a conditional vertical offset, and adds a placeholder text to the input.