A Modal is a component that appears on top of the current screen to show important information or get user input. It blocks interaction with the rest of the app until dismissed.
Click to reveal answer
beginner
How does a Bottom Sheet differ from a Modal?
A Bottom Sheet slides up from the bottom of the screen and usually covers part of the screen. It is less intrusive than a Modal and often used for actions or options.
Click to reveal answer
beginner
Which React Native component is used to create a Modal?
The built-in Modal component is used to create modals in React Native.
Click to reveal answer
beginner
What prop controls the visibility of a Modal in React Native?
The visible prop controls whether the Modal is shown (true) or hidden (false).
Click to reveal answer
intermediate
Name one popular library to implement Bottom Sheets in React Native.
One popular library is reanimated-bottom-sheet or @gorhom/bottom-sheet which provide customizable bottom sheets.
Click to reveal answer
What happens when a Modal is visible in React Native?
AIt allows interaction with the background screen.
BIt blocks interaction with the rest of the app until dismissed.
CIt automatically closes after 5 seconds.
DIt moves the screen content to the top.
✗ Incorrect
A Modal blocks interaction with the rest of the app until the user dismisses it.
Which prop do you use to show or hide a Modal?
Ashow
Bdisplay
Cactive
Dvisible
✗ Incorrect
The visible prop controls the Modal's visibility.
A Bottom Sheet usually appears from where on the screen?
ATop
BLeft
CBottom
DCenter
✗ Incorrect
A Bottom Sheet slides up from the bottom of the screen.
Which React Native component is built-in for Modals?
AModal
BPopup
CDialog
DSheet
✗ Incorrect
React Native provides a built-in Modal component.
Which library can help create Bottom Sheets in React Native?
Areanimated-bottom-sheet
Baxios
Credux
Dreact-navigation
✗ Incorrect
reanimated-bottom-sheet is a popular library for Bottom Sheets.
Explain how a Modal works in React Native and when you might use it.
Think about a popup that stops you from using the app until you respond.
You got /3 concepts.
Describe the difference between a Modal and a Bottom Sheet in mobile apps.
Imagine a popup vs a sliding panel from the bottom.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of a Modal component in React Native?
easy
A. To display content over the current screen and keep user focus
B. To navigate between different screens
C. To create a permanent footer on the screen
D. To handle background tasks silently
Solution
Step 1: Understand what a Modal does
A Modal appears on top of the current screen and blocks interaction with the background.
Step 2: Compare options
Only To display content over the current screen and keep user focus describes this behavior correctly; others describe unrelated features.
Final Answer:
To display content over the current screen and keep user focus -> Option A
Quick Check:
Modal = Overlay content [OK]
Hint: Modals block background, focus user attention [OK]
Common Mistakes:
Confusing Modal with navigation
Thinking Modal is a footer or background task
Assuming Modal is always full screen
2. Which of the following is the correct way to control the visibility of a Modal in React Native?
easy
A. <Modal show={true}>
B. <Modal visible={true}>
C. <Modal isVisible={true}>
D. <Modal display={true}>
Solution
Step 1: Recall the correct prop for Modal visibility
The React Native Modal uses the visible prop to show or hide the modal.
Step 2: Check each option
Only <Modal visible={true}> uses visible correctly; others use incorrect prop names.
Final Answer:
<Modal visible={true}> -> Option B
Quick Check:
Modal visibility prop = visible [OK]
Hint: Use visible prop to toggle Modal display [OK]
Common Mistakes:
Using show or isVisible instead of visible
Confusing display with visible
Forgetting to pass boolean value
3. What will happen when the following React Native code runs?
B. The Button component is outside the Modal and will not render
C. Modal must be wrapped inside a single parent element
D. The visible prop should be a string, not boolean
Solution
Step 1: Check JSX structure
The return statement has two sibling elements: Modal and Button, which is invalid JSX without a wrapper.
Step 2: Identify correct fix
Wrapping Modal and Button inside a fragment or View fixes the error.
Final Answer:
Modal must be wrapped inside a single parent element -> Option C
Quick Check:
JSX requires one parent element [OK]
Hint: Wrap siblings in a fragment or View [OK]
Common Mistakes:
Ignoring JSX syntax rules
Thinking onRequestClose is optional on Android
Confusing visible prop type
5. You want to create a bottom sheet modal that slides up from the bottom and closes when tapping outside it. Which combination of props and components achieves this behavior in React Native?
hard
A. Use Modal visible={false} animationType="slide" transparent={true} with no tap detection
B. Use Modal visible={true} animationType="fade" without transparent prop and no tap detection
C. Use Modal visible={true} animationType="none" transparent={false} with a Button inside
D. Use Modal visible={true} animationType="slide" transparent={true} with a TouchableWithoutFeedback wrapping the background to detect taps