Skip to content

Commit 73efb07

Browse files
committed
chore: remove support for react-native-document-picker
1 parent e443caf commit 73efb07

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

Diff for: package/native-package/package.json

-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"react-native": ">=0.67.0",
3030
"react-native-audio-recorder-player": ">=3.6.4",
3131
"react-native-blob-util": ">=0.19.9",
32-
"react-native-document-picker": ">=9.3.0",
3332
"@react-native-documents/picker": ">=10.1.1",
3433
"react-native-haptic-feedback": ">=2.2.0",
3534
"react-native-image-picker": ">=7.1.2",
@@ -49,9 +48,6 @@
4948
"react-native-share": {
5049
"optional": true
5150
},
52-
"react-native-document-picker": {
53-
"optional": true
54-
},
5551
"@react-native-documents/picker": {
5652
"optional": true
5753
},

Diff for: package/native-package/src/optionalDependencies/pickDocument.ts

+4-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Types are approximated from what we need from the DocumentPicker API.
33
*
4-
* For its full API, see https://github.com/rnmods/react-native-document-picker/blob/master/src/index.tsx
4+
* For its full API, see https://github.com/react-native-documents/document-picker/blob/main/packages/document-picker/src/index.ts
55
* */
66
type ResponseValue = {
77
name: string;
@@ -19,31 +19,12 @@ type DocumentPickerType =
1919

2020
let DocumentPicker: DocumentPickerType;
2121

22-
let OldDocumentPicker: DocumentPickerType;
23-
let NewDocumentPicker: DocumentPickerType;
24-
25-
try {
26-
NewDocumentPicker = require('@react-native-documents/picker');
27-
} catch (err) {
28-
// we log below
29-
}
30-
3122
try {
32-
OldDocumentPicker = require('react-native-document-picker').default;
23+
DocumentPicker = require('@react-native-documents/picker');
3324
} catch (err) {
34-
// we log below
35-
}
36-
37-
if (NewDocumentPicker) {
38-
DocumentPicker = NewDocumentPicker;
39-
} else if (OldDocumentPicker) {
40-
DocumentPicker = OldDocumentPicker;
41-
console.log(
42-
"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 !",
43-
);
44-
} else {
25+
// do nothing
4526
console.log(
46-
'Neither react-native-document-picker nor @react-native-documents/picker are installed.',
27+
'The @react-native-documents/picker is not installed. Installing it will enable you to pick and upload files from within your app.',
4728
);
4829
}
4930

0 commit comments

Comments
 (0)