V
V
Vadim Rublev2021-07-30 16:56:39
React
Vadim Rublev, 2021-07-30 16:56:39

Why is locally connected React not working?

Why is locally connected React not working? With a CDN connection, the same files work.

<!DOCTYPE HTML>
<html>
<head>
    <meta content="text/html; charset=UTF-8">
    <title>Test React</title>
    <script src="react.development.js"></script>
    <script src="react-dom.development.js"></script>
    <script src="https://unpkg.com/@babel/standalone/babel.min.js" crossorigin></script>
</head>
 
<body>
    <div id="myDiv"></div>	
  <script type="text/babel">
    ReactDOM.render("My React", document.querySelector('#myDiv'));
  </script>
</body>
</html>


610412cc90358476171977.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
black1277, 2021-07-30
@black1277

Because the security policy of browsers prohibits the simultaneous use of local and network files.

S
Stanislav Gladky, 2021-07-30
@xareyli

Better use npx create-react-app

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question