Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onPress = async ()=>{
let files = []
try{
files = await DocumentPicker.pickMultiple({
type: [
DocumentPicker.types.images,
DocumentPicker.types.pdf,
DocumentPicker.types.plainText,
DocumentPicker.types.video,
...Platform.select({
ios: ['com.microsoft.word.doc', 'com.microsoft.excel.xls', 'com.microsoft.powerpoint.ppt', 'org.openxmlformats.wordprocessingml.document', 'org.openxmlformats.spreadsheetml.sheet', 'org.openxmlformats.presentationml.presentation', 'org.openxmlformats.presentationml.slideshow'],
android: ['application/*']//doc,etc...
})
],
})
}catch(e){}
if (!files.length)
return