Skip to content

Custom hook does not work with beforeAddFile #208

Open
@kevinntruo

Description

@kevinntruo

Is there an existing issue for this?

  • I have searched the existing issues

Have you updated React FilePond, FilePond, and all plugins?

  • I have updated FilePond and its plugins

Describe the bug

I have created a useConfirm hook that returns a Promise by opening a dialog.
This works for beforeRemoveFile but not beforeAddFile.
Is this expected?
Besides, is there a way to use useConfirm before the file processes (aka. before uploading to the server)?

Reproduction

I have composed a CodeSandBox for demo purposes.

https://codesandbox.io/s/musing-kare-x82m3p?file=/src/Upload.js

Environment

- OS: Windows 10
- Browser: Chrome
- React version: 17.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions