0

I'm trying to export an html file (located on the server) as a string so that I can render it in react (currently willing to use html-react-parser to convert it into react elements). I've used "require" along with html-loader package (which apparently helps with the conversion process) but couldn't get it to work. I think "require" works only for static files because upon inserting the URL in require (i.e require("http://localhost:8080/...)), an error shows up saying that it can't find the module.

Is there any other way to accomplish this (rendering html file on server in react) without this hassle? I'm using Django as backend if that's useful in any way.

0 Answers0