0
0
React Nativemobile~5 mins

Camera access (expo-camera) in React Native - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the expo-camera library in React Native?
The expo-camera library allows React Native apps to access and use the device's camera for taking photos and recording videos.
Click to reveal answer
beginner
How do you request permission to use the camera with expo-camera?
You use the Camera.requestCameraPermissionsAsync() method to ask the user for permission to access the camera.
Click to reveal answer
beginner
What React hook is commonly used to manage camera permission state in a functional component?
The useState hook is used to store and update the camera permission status (granted or denied).
Click to reveal answer
intermediate
Why should you check camera permissions before rendering the camera view?
Checking permissions first ensures the app only tries to show the camera if the user has allowed access, preventing errors and improving user experience.
Click to reveal answer
beginner
How do you display the camera preview on screen using expo-camera?
You render the <Camera> component from expo-camera and set its style and type (front or back camera).
Click to reveal answer
Which method requests camera permission in expo-camera?
ACamera.getPermissions()
BPermissions.askCamera()
CCamera.requestCameraPermissionsAsync()
DCamera.enable()
What React hook is best to track if camera permission is granted?
AuseState
BuseContext
CuseRef
DuseEffect
Which component shows the live camera feed in expo-camera?
A&lt;Camera&gt;
B&lt;CameraFeed&gt;
C&lt;CameraView&gt;
D&lt;CameraPreview&gt;
What should you do if camera permission is denied?
AForce camera to open anyway
BShow an error message or alternative UI
CRestart the app
DIgnore and continue
Which camera type can you select in expo-camera?
AOnly front camera
BNo camera selection possible
COnly back camera
DFront or back camera
Explain how to request and handle camera permissions using expo-camera in a React Native app.
Think about asking the user first, then showing the camera only if allowed.
You got /4 concepts.
    Describe how to display a live camera preview using the expo-camera library.
    Focus on the component and props needed for the preview.
    You got /4 concepts.