I’ve solved my problem.
handleClick = () => {
fetch('/sample.txt')
.then((r) => r.text())
.then(text => {
console.log(text);
})
}
Tis link did help:
Fetch local JSON file from public folder ReactJS
I’ve solved my problem.
handleClick = () => {
fetch('/sample.txt')
.then((r) => r.text())
.then(text => {
console.log(text);
})
}
Tis link did help:
Fetch local JSON file from public folder ReactJS