I want load a CSV file and send it to backend. To do that I used react-csv-reader. I basically load a file, and after that I push another button and send the data to backend. My problem is that after sending it to backend the file still remains as selected/uploaded. How can I remove or clean that?
My code:
<CSVReader
cssClass="myCSS"
label="Choose a CSV"
inputId="myCSV"
inputName="myCSV"
inputStyle={{ color: 'red' }}
onFileLoaded={data => handleUploading(data)}
/>
//...
const handleUploading = data => {
setSelectedFile(data);
};
As I said, I have my file content into data and I send that to backend but the file still remains as "loaded". Is there any way to clean that?