Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
Including two react application in one external web page

I have two react application deployed as header and footer at some urls header - 'someurl/header' footer - 'someurl/footer' I want to integrate this in a third application I am able to integrate one of them at a time and both the react application is properly loaded but when i integrate both of them together only first application loads properly, second also renders but not as react component Here is my code snippet

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin>. 
</script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" 
crossorigin></script>
 <script  src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
 </head>

 <body>

 <script async> 

  fetch('http://url/footer')
  .then((response) => response.text())
  .then(data => {
    const node = document.createRange().createContextualFragment(data);
    document.getElementById("footer-container").appendChild(node);
  }); 

  
</script>

<script defer > 

 fetch('http://url/header')
    .then((response) => response.text())
    .then(data => {
    const node = document.createRange().createContextualFragment(data);
      document.getElementById("header-container").appendChild(node)
         
    });
 
</script>
<div id="header-container"></div>
<div id="outer_div">outer content</div>
<div id="footer-container"></div>

Any help or hints is appreciated thanks in advance

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda