You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Select_File = async () => {
const { formData } = this.state;
try {
const res = await DocumentPicker.pick({
type: [DocumentPicker.types.images, DocumentPicker.types.pdf]
});
this.setState({
fileformData: [{ uri: res.uri, type: res.type, name: res.name }]
});
} catch (err) {
if (DocumentPicker.isCancel(err)) {
// User cancelled the picker, exit any dialogs or menus and move on
} else {
throw err;
}
}
};
Steps to reproduce
Whenever I'm calling Select_File fun, i'm getting warning Possible Unhandled Promise Rejection (id: 11): TypeError: null is not an object (evaluating 'RNDocumentPicker.pickDirectory') pickDirectory@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:202901:34
in emulator/real device.
I also tried with the different versions of react-native-document-picker but I'm getting this warning in all versions.
Activity
vonovak commentedon Oct 7, 2021
hello, can you please try with version 7 and report back? Thanks
scrapecoder commentedon Oct 7, 2021
@vonovak I already tried but no luck
vonovak commentedon Oct 7, 2021
What platform is it on?
Cavech84 commentedon Oct 8, 2021
I have the same problem...
"react": "17.0.2",
"react-native": "0.64.2",
"react-native-document-picker": "^7.1.0",
the result of DocumentPicker.pick is undefined :
vonovak commentedon Oct 8, 2021
hello, please read the docs for pick: https://github.com/rnmods/react-native-document-picker#documentpickerpickmultipleoptions--documentpickerpicksingleoptions--documentpickerpickoptions
it returns an array, not an object.
Thank you! :)