Skip to content

Commit 1c891b9

Browse files
committed
ComposeMenu [nfc]: Import DocumentPicker the normal way
I don't get any warnings from Jest with this usual style of import. It looks like r-n-document-picker handled that in react-native-documents/document-picker#474 , first released in v6.0.5. We upgraded past that version a few commits ago.
1 parent ad7f5f2 commit 1c891b9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/compose/ComposeMenu.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Color from 'color';
44
import React, { useCallback, useContext, useMemo } from 'react';
55
import type { Node } from 'react';
66
import { Platform, View, Alert, Linking, Pressable } from 'react-native';
7+
import DocumentPicker from 'react-native-document-picker';
78
import type { DocumentPickerResponse } from 'react-native-document-picker';
89
import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
910

@@ -208,10 +209,6 @@ export default function ComposeMenu(props: Props): Node {
208209
}, [_, handleImagePickerResponse]);
209210

210211
const handleFilesPicker = useCallback(async () => {
211-
// Defer import to here, to avoid an obnoxious import-time warning
212-
// from this library when in the test environment.
213-
const DocumentPicker = (await import('react-native-document-picker')).default;
214-
215212
let response = undefined;
216213
try {
217214
response = (await DocumentPicker.pickMultiple({

0 commit comments

Comments
 (0)