import * as DocumentPicker from 'expo-document-picker'; import React from 'react'; import { Alert, Image, Text, View } from 'react-native'; import Button from '../components/Button'; import TitleSwitch from '../components/TitledSwitch'; export default function DocumentPickerScreen() { const [copyToCache, setCopyToCache] = React.useState(false); const [document, setDocument] = React.useState(null); const openPicker = async () => { const result = await DocumentPicker.getDocumentAsync({ copyToCacheDirectory: copyToCache, }); if (result.type === 'success') { setDocument(result); } else { setTimeout(() => { Alert.alert('Document picked', JSON.stringify(result, null, 2)); }, 100); } }; return (