import {pick, types} from '@react-native-documents/picker';
<Button
title={"UPLOAD"}
onPress={async () => {
try {
const [pickResult] = await pick();
console.log("PICKED FILES: ", pickResult);
} catch (err: unknown) {
console.error(err);
}
}}
/>
I'm using react native document picker for file upload operation. After clicking the button the picker opens and after cancelling it closes but when I click the button again it returns the error:
ERROR [Error: Warning: previous promise did not settle and you attempted to overwrite it. You've called "pick" while "pick" was already in progress and has not completed yet.]
Seems like the pick option does not terminate correctly after cancelling or selecting any file. The result for the selected file is not displayed either.
document picker version: "10.1.1"
react native version: "0.74.1"
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745108557a4611705.html
评论列表(0条)