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

200
Views
why react & react-DOM is undefined using?

I am trying to use react component in javascript project. I follow the these steps mentions in below links

https://www.fabiofranchino.com/blog/create-react-reusable-components-library-with-microbundle/

import ReactDOM from "react-dom"
import React from "react"
import {A} from "../components/sub/A";
export const Abc = ()=>{
    console.log('---ddd')
    console.log('---React',React)
    console.log('---ReactDOM',ReactDOM)
    console.log('---rootEl',document.getElementById("demo-test"))
    ReactDOM.render(<A/>, document.getElementById("demo-test"))

}

window.Abc = Abc;
window.React = React;
window.ReactDOM = ReactDOM;

I used the bundle in javascript project . but getting react and react DOM undefined . when I call window.Abc()

<!DOCTYPE html>
<html>
  <head>
    <title>Parcel Sandbox</title>
    <meta charset="UTF-8" />
    <script
      crossorigin
      src="https://unpkg.com/react@18/umd/react.production.min.js"
    ></script>
    <script
      crossorigin
      src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
    ></script>
  </head>

  <body>
    <div id="demo-test"></div>

    <script src="src/index.js"></script>
  </body>
</html>

I already included React and React DOM library

here is my code https://codesandbox.io/s/eloquent-brahmagupta-24iniq?file=/index.html

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!