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

112
Vistas
Window add event listener load not working with text/babel

Whenever I set the script type to text/babel or text/jsx, the document and window event listeners stop working, does anyone know why this happens and how could it be fixed?, thanks

If there is no solution is there any alternative to use babel and window listener together?

This is the html code:

<!DOCTYPE html>
<html lang="en">
    <body>
        <div id="root"></div>

        <script src="https://unpkg.com/react@17/umd/react.production.min.js" crossorigin></script>
        <script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js" crossorigin></script>
        <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
        <script src="dos.js" type="text/jsx"></script>
    </body>
</html>

And this is the js code:

ReactDOM.render(
    <h1>Hello, world!</h1>,
    document.getElementById('root')
);

window.addEventListener('load', () => {
    console.log('hi')
})
about 4 years ago · Juan Pablo Isaza
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