refactor(csv-column-read2dom): get rid of excess file app/components/input.jsx

This commit is contained in:
dancingCycle 2023-06-22 06:28:55 +02:00
parent 98497ec1d6
commit e63f058e35
1 changed files with 0 additions and 27 deletions

View File

@ -1,27 +0,0 @@
import React from 'react';
const Input = () => {
const handleChange = (e) => {
const reader = new FileReader();
reader.onload = () => {
// @ts-ignore
document.getElementById('out').innerHTML = reader.result;
};
// start reading the file. When it is done, calls the onload event defined above.
// @ts-ignore
reader.readAsBinaryString(document.getElementById('csv-input').files[0]);
};
return (
<>
<h3>Input</h3>
<input
accept=".csv"
id="csv-input"
onChange={handleChange}
type="file"
/>
<pre id="out"><p>File contents will appear here</p></pre>
</>
);
};
export default Input;