I'm trying to return a piece of html code in a react function. However, rather than copying the file I want and put it the concerned code in quotes, I would like to do something like :
my_func() {
return doc.documentElement.innerHTML;
}
Where doc would be a reference to some other file like :
./path/myfile.html
Is there any method that allows me to do that? Or am I constrained to copy all the code in my file.html and put it in quotes in my return function?
Thanks