R
R
ReactorMan2017-10-06 02:35:32
React
ReactorMan, 2017-10-06 02:35:32

What is wrong with HelloWorld React?

Full page code:

<!DOCTYPE html>
<html lang="ru">
<head>
  <meta charset="utf-8">
  <title>Заголовок</title>
</head>
<body>

<div id="root">
  <!-- This div's content will be managed by React. -->
</div>

<script type="text/JavaScript" src="https://unpkg.com/react/umd/react.development.js"></script>
<script type="text/JavaScript" src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>

<script type="text/JavaScript">
  ReactDOM.render(
  <h1>Hello, world!</h1>,
  document.getElementById('root')
  );
</script>

</body>
</html>

Error on line 18 Uncaught SyntaxError: Unexpected token < this is a string , the editor also highlights the code strangely, it asks for quotes, but if you put it in quotes, then the page displays an inscription just like that with html tags that look like a test. It is not clear in this regard how their example works https://codepen.io/gaearon/pen/ZpvBNJ<h1>Hello, world!</h1>'<h1>Hello, world!</h1>'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question