react-native-document-picker: Type error-->undefined document picker while calling document picker.show in react native 0.61.2

Viewed 1662

enter image description here

When upgraded to react-native 0.61.2 this issue came. I did, Removed apk from mobile and automatically linking using

react-native link

then

react-native run-android

but the issue exist.

2 Answers

In new version of react-native-document-picker@3.2.4. They changed method names earlier versions of document picker we import DocumentPicker and DocumentPickerUtil both methods, but in new version of this npm we will import only one method DocumentPicker.

Replace this

import { DocumentPicker, DocumentPickerUtil } from "react-native-document-picker";

To this

import DocumentPicker from 'react-native-document-picker';

Downgrade your react-native version to 0.61.0. The recent version (0.61.2) is not yet stable with react-native-document-picker and expo-document-picker.

Related