Complete the code to import the Modal component from React Native.
import { [1] } from 'react-native';
The Modal component is imported from react-native to create modal dialogs.
Complete the code to make the Modal visible when the state variable is true.
<Modal visible=[1] animationType="slide">
The visible prop controls if the Modal is shown. It should be set to the state variable modalVisible.
Fix the error in the code to close the Modal when the button is pressed.
<Button title="Close" onPress={() => [1](false)} />
The onPress should call the setter function setModalVisible to update the state and close the Modal.
Fill both blanks to create a bottom sheet using React Native's Modal with transparent background and slide animation.
<Modal transparent=[1] animationType=[2] visible={modalVisible}>
To create a bottom sheet effect, the Modal should be transparent with value true and use animationType set to "slide".
Fill all three blanks to define a state hook for modal visibility and a button to open the modal.
const [modalVisible, [1]] = useState([2]); <Button title="Open Modal" onPress={() => [3](true)} />
The state hook returns the variable and setter: modalVisible and setModalVisible. Initial value is false. The button calls setModalVisible(true) to open the modal.