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

Code Example 1

<input type="file" accept=".gif,.jpg,.jpeg,.png,.doc,.docx">

Learn ReactJs, React Native from akashmittal.com