Very beginner question here, after some high level guidance.
I have a React (typescript) app which simply contains a button with some blockchain functionality. I also have a simple html page which displays an interactive 3D artwork in a JavaScript file 3Dscene.js.
I simply want to combine the two elements. The 3Dscene.js contains all the module imports it needs. I was hoping I could just add a <script type = 'module' src = './3Dscene.js'> to the Reacts index.html, which works if I am just using a standard html/js setup. But it gives me an error "Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html".
At a high level, how would one normally go about this?
ok the thing is React renders the virtual DOM and it actually does not provide a way for you to display html. For that to happen in any way, create a .jsx file from your html/js code which could be rendered as one of your components. This is one legit method to achieve it. Not rendering directly is the problem here, that's the reason why web crawlers don't even crawl through react apps cuz only thing the search engines see is plain js scripts! That's where framework like Next.js comes in.
If this doesn't answer the question, could you please describe what else method have you looked for?