V
V
Vladimir Vladimirovich2017-04-06 00:22:39
css
Vladimir Vladimirovich, 2017-04-06 00:22:39

How to connect babel correctly?

when trying to register in the app.js file, an error appears

console.log(React);
console.log(ReactDOM);

ReactDOM.render(
  <h1>Hello, world!</h1>,
  document.getElementById('root')
);

the browser swears at the symbol <. Okay, I downloaded the babel library, named the file browser.min.js.
index.html content
<!DOCTYPE html>
<html>
  <head>
    <title>React [RU] Tutorial</title>
  </head>
  <body>
    <div id="root">Привет, я #root)</div>
    <script src="js/react/react.js"></script>
    <script src="js/react/react-dom.js"></script>
    <script src="js/react/browser.min.js"></script>
    <script type="text/babel" src="js/app.js"></script>
  </body>
</html>

but at the same time I get f29ebca8f1dc4589b8f265564a7fd87a.png
if I write: type="text/jsx" src="js/app.js"
then I get an empty page (although without errors)

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