I am new to react and I can upload an excel file successfully so far.
Here is my render method:
render() {
return (
<div className="cardUploader">
<div className="card">
<ControlLabel>
<PageHeader>
<h4> CARD UPLOADER</h4>
</PageHeader>
</ControlLabel>
<div onSubmit={this.onFormSubmit}>
<input
type="file"
name="file"
accept=".xlsx"
onChange={e => this.onChange(e)}
/>
</div>
</div>
</div>
);
}
This is the method of loading the excel file:
onChange(e) {
let files = e.target.files;
//creating a file reader object
let reader = new FileReader();
reader.readAsDataURL(files[0]);
//Checking whether the file is loaded or not
reader.onload = e => {
console.log("File loaded", e.target.result);
};
}
Upto this point it is working properly.I need to convert excel data into react table data and store in the react table.Is there any method to convert data in an excel sheet into React Table data?