Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!