Using IntelliJ Idea 并创建了一个 index.htm 文件
我只是尝试包含以下链接并在服务器端
运行代码屏幕上没有渲染任何内容:
<html >
<head>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<title>Live Link</title>
</head>
<body>
<div id="Output"></div>
<script type="text/babel">
ReactDOM.render(<h1>Hello Human</h1>, window.document.getElementById('Output'));
</script>
</body>
</html>
此旧版本链接有效,但新版本链接不起作用。
https://stackoverflow.com/a/33963992/5078763
在控制台.log中出现以下错误:
babel.min.js:5 Uncaught SyntaxError: Invalid regular expression: Range out of order in character class
at new RegExp (<anonymous>)
at Object.<anonymous> (babel.min.js:5)
at t (babel.min.js:1)
at Object.t.__esModule (babel.min.js:19)
at t (babel.min.js:1)
at Object.<anonymous> (babel.min.js:2)
at t (babel.min.js:1)
at Object.e.exports (babel.min.js:1)
at t (babel.min.js:1)
at Object.e.exports.version (babel.min.js:1)
(anonymous) @ babel.min.js:5
t @ babel.min.js:1
t.__esModule @ babel.min.js:19
t @ babel.min.js:1
(anonymous) @ babel.min.js:2
t @ babel.min.js:1
e.exports @ babel.min.js:1
t @ babel.min.js:1
e.exports.version @ babel.min.js:1
t @ babel.min.js:1
t.__esModule @ babel.min.js:16
t @ babel.min.js:1
t.__esModule @ babel.min.js:11
t @ babel.min.js:1
(anonymous) @ babel.min.js:2
t.__esModule @ babel.min.js:2
t @ babel.min.js:1
t.__esModule @ babel.min.js:10
t @ babel.min.js:1
t.__esModule @ babel.min.js:14
t @ babel.min.js:1
t.__esModule @ babel.min.js:1
t @ babel.min.js:1
(anonymous) @ babel.min.js:1
(anonymous) @ babel.min.js:1
(anonymous) @ babel.min.js:1
(anonymous) @ babel.min.js:1
raven.min.js:2 <img>
缩小
的babel.min.js
包含 utf-8 编码的字符串。您可以通过在<head>
中放置一个<meta charset="utf-8">
来使您的示例正常工作。