Bunlong / react-papaparse

react-papaparse is the fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
https://react-papaparse.js.org
MIT License
363 stars 60 forks source link

CSVReader onRemoveFile #144

Open mperone opened 1 year ago

mperone commented 1 year ago

I can't seem to figure out from the docs and source code how to handle the old onRemoveFile behavior for CSVReader. I only see onUploadAccepted (can use to replace my old code for onDrop) and onUploadRejected (can use to replace my old code for onError). How can I run my own logic when the file is removed?

JamesIV4 commented 9 months ago

In case you didn't find this solution, here's something that works

{...getRemoveFileProps()}
onClick={(event: Event) => {
    getRemoveFileProps().onClick(event);
    // Your code here
}
mperone commented 9 months ago

Thanks, will check it out!