I have a scenario which I'd like to implement but I'm not too sure on how to. Details provided below:
Technology used: React (frontend), Quarkus with Kotlin (backend)
I have a bunch of HTML files which depend on other resources like images, animations, css & plugins. The resources have seperate folders and are shared among the the HTML files reside in the root directory. In the react component on my frontend, I'd like to fetch individual HTML files and display/render them on the clients browser (Keeping in mind, the necessary resources [CSS, JS, ...] should also be populated). Basically, I'd want to user to be able to interact with the HTML content but not be able to download them. How can this be acheived with the above technology stack?
Any input would be greatly appreciated and TIA!
These are implementations which I've already tried with a sample HTML file (without the folder structure as mentioned above. I just wanted to see if rendering HTML with JS was possible) which includes JS and CSS.
- Using dangerouslysetinnerhtml - Failed to download the JS (Probably wouldn't prefer this method too)
- Using html-react-parser library - Failed to load the JS as well
- Using - Didn't yield the expected result too