Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
Combining React app with simple html/js page

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?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

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?

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda