Check out example codes for "how to upload a file in capybara spec". It will help you in understanding the concepts better.

Code Example 1

attach_file("Upload Your File", Rails.root + "spec/fixtures/file.pdf")

Learn ReactJs, React Native from akashmittal.com