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

Code Example 1

<input type="file" name="myImage" accept="image/x-png,image/gif,image/jpeg" />

Learn ReactJs, React Native from akashmittal.com