In my Reactjs application I used the anchor tag to download a txt file like below.
downloa
Try like this
import File from 'http://textfiles.com/......./sample.txt'; //Or the path could be any relative path to the local file.
//Other code
render() {
return(
//Code
download
)
}
But inorder to use like this, you should be confident that you will get the file without any issues. Better to download the file and access it from your own directory instead of calling from another server.