<div id="test"></div>
// 获取容器节点
const domContainer = document.querySelector('#test')
// 创建虚拟 DOM
const VDOM = <h1 id="title">Hello React!</h1>
// 渲染虚拟 DOM 到页面对应的节点上
ReactDOM.render(VDOM, domContainer)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello React</title>
<script src="./react.development-16.8.4.js"></script>
<script src="./react-dom.development-16.8.4.js"></script>
<script src="../babel/babel.min.js"></script>
</head>
<body>
<div id="test"></div>
<script type="text/babel">
// 获取容器节点
const domContainer = document.querySelector('#test')
// 创建虚拟 DOM
const VDOM = <h1 id="title">Hello React!</h1>
// 渲染虚拟 DOM 到页面对应的节点上
ReactDOM.render(VDOM, domContainer)
</script>
</body>
</html>