pick function in react document picker does not terminate after selecting any file or using the cancel button in android - Stack

import {pick, types} from '@react-native-documentspicker';<Buttontitle={"UPLOAD"

      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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信