react-component / react-component/upload

`multiple` with `customRequest`

Open
#242 4 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
804
Forks
323
Avg merge
12m
Merged PRs (30d)
1

Description

Hi, i'm trying to allow multiple files upload with customRequest.

const foo = (file) => {
  console.log(file);
};

<Upload
  multiple
  customRequest={foo}
  ...

My issue is that file is being logged once per file instead of receiving an array of files as a native file input would do.

Do you know anyway around this? If not I would need to add these files to state and somehow determine when no more files and only then trigger the request... which is not desired.

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Upload component's customRequest path and inspect how each selected file is passed to the callback. Clarify whether multiple selection should provide one array or preserve per-file requests, then add coverage for the chosen behavior and verify that all selected files are handled together.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.