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

193
Views
Can't figure out why my React Component isn't rendering?

Is there an issue with how I imported react or am I just missing something small? Any feedback would be greatly appreciated. I'm pretty new to programming so there's probably a really simple solution here that I'm just not informed enough to see. Thanks.

Edit: After taking out the commented out portion of the body, the component still doesn't render. I get this error

Uncaught SyntaxError: Unexpected token '<' (at index.html:22:13)

Can the file not understand that I'm trying to use a react component? Thanks.

2nd edit: Solved it, I was missing type="text/babel" in the script element.

    <!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- CSS only -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">


    <!-- React Import -->
    <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/babel.min.js"></script>

    <title>Markdown Previewer</title>
  </head>

    <script>
      class App extends React.Component {
        render() {
          return(
            <div class="">
            Hi
            </div>
          );
        }
      }

      ReactDOM.render(<App/>,
      document.getElementById('app'));
    </script>

  <body>
    <!--<wrapper>
      <div id="app"></div>
      <textarea name="name" rows="8" cols="80" id="editor"></textarea>
      <div id="preview"></div>
    </wrapper>-->
    <!-- JavaScript Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
    <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>



  </body>
</html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

remove comment braces: <!-- -->

and write just:

<wrapper>
  <div id="app"></div>
  <textarea name="name" rows="8" cols="80" id="editor"></textarea>
  <div id="preview"></div>
</wrapper>
about 4 years ago · Juan Pablo Isaza Report
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!