import { CameraView, useCameraPermissions } from 'expo-camera'; import { useRef, useState } from 'react'; import { Button, Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; export default function App() { const [permission, requestPermission] = useCameraPermissions(); const [photo, setPhoto] = useState(''); const cameraRef = useRef(null); async function _takePhoto() { if (cameraRef.current) { const pic = await cameraRef.current.takePictureAsync() setPhoto(pic.uri); console.debug(photo) } } if (!permission) { // Camera permissions are still loading. return ; } if (!permission.granted) { // Camera permissions are not granted yet. return ( We need your permission to show the camera