-2

when i run this code in google chrome it dose not work it is just a blank page

<!DOCTYPE html>
<html>
  <head>
    <title> "REACT EXAMPLE"></title>
    <script src="react.js"></script>
    <script src="react-dom.js"></script>
  </head>
  <body>
    <div id="container"></div>
    <script type="text/jsx">
      ReactDOM.render(
        <h1> "hello, React!"<h1>,
        document.getElementById('container')
      );
    </script>
  </body>
<html>
Abu ali
  • 19
  • 2

2 Answers2

0

You haven't closed the "h1" tag.

Do like that:

 <h1> "hello, React!"</h1>,
Roman Unt
  • 893
  • 7
  • 8
0

why are you doing this in the body?

  <body>
    <div id="container"></div>
    <script type="text/jsx">
      ReactDOM.render(
        <h1> "hello, React!"<h1>,
        document.getElementById('container')
      );
    </script>
  </body>

this should be outside in your src/index.js file:

ReactDOM.render(<App />, document.getElementById('container'))

Red Baron
  • 7,181
  • 10
  • 39
  • 86