Check out example codes for "input type file csv only". It will help you in understanding the concepts better.

Code Example 1

<input type="file" id="img" name="img" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">

Learn ReactJs, React Native from akashmittal.com