diff --git a/package/native-package/package.json b/package/native-package/package.json index 1ff4600b5e..54d86fcbba 100644 --- a/package/native-package/package.json +++ b/package/native-package/package.json @@ -29,7 +29,6 @@ "react-native": ">=0.67.0", "react-native-audio-recorder-player": ">=3.6.4", "react-native-blob-util": ">=0.19.9", - "react-native-document-picker": ">=9.3.0", "@react-native-documents/picker": ">=10.1.1", "react-native-haptic-feedback": ">=2.2.0", "react-native-image-picker": ">=7.1.2", @@ -49,9 +48,6 @@ "react-native-share": { "optional": true }, - "react-native-document-picker": { - "optional": true - }, "@react-native-documents/picker": { "optional": true }, diff --git a/package/native-package/src/optionalDependencies/pickDocument.ts b/package/native-package/src/optionalDependencies/pickDocument.ts index a0bab9279b..3ed801cec4 100644 --- a/package/native-package/src/optionalDependencies/pickDocument.ts +++ b/package/native-package/src/optionalDependencies/pickDocument.ts @@ -1,7 +1,7 @@ /** * Types are approximated from what we need from the DocumentPicker API. * - * For its full API, see https://github.com/rnmods/react-native-document-picker/blob/master/src/index.tsx + * For its full API, see https://github.com/react-native-documents/document-picker/blob/main/packages/document-picker/src/index.ts * */ type ResponseValue = { name: string; @@ -19,31 +19,12 @@ type DocumentPickerType = let DocumentPicker: DocumentPickerType; -let OldDocumentPicker: DocumentPickerType; -let NewDocumentPicker: DocumentPickerType; - -try { - NewDocumentPicker = require('@react-native-documents/picker'); -} catch (err) { - // we log below -} - try { - OldDocumentPicker = require('react-native-document-picker').default; + DocumentPicker = require('@react-native-documents/picker'); } catch (err) { - // we log below -} - -if (NewDocumentPicker) { - DocumentPicker = NewDocumentPicker; -} else if (OldDocumentPicker) { - DocumentPicker = OldDocumentPicker; - console.log( - "You're using the react-native-document-picker library, which is no longer supported and has moved to @react-native-documents/picker. Things might not work as intended. Please migrate to the new library as soon as possible !", - ); -} else { + // do nothing console.log( - 'Neither react-native-document-picker nor @react-native-documents/picker are installed.', + 'The @react-native-documents/picker is not installed. Installing it will enable you to pick and upload files from within your app.', ); }