Q:

ReactJS Static File

I would like to know how to serve txt files like robots.txt and verify.txt in a ReactJS app? 
Eg: http://localhost:3000/.well-known/apple-developer-merchantid-domain-association.txt
So far I have tried adding the files to the public folder, but the app does not recognize the URL.
Thanks in advance

A:

The following solution works for serving a static file via React JS React Router. 

Add the file to the public folder
Include a route that points to the static file in the public folder Eg: /robots.txt:

Solution via React Router
const reload = () => window.location.reload();

<Route path="/my-static-file.ext" onEnter={reload} />

