<!-- 引入 react 18.2 -->
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-y/react/18.2.0/umd/react.development.min.js"></script>
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-y/react-dom/18.2.0/umd/react-dom.development.min.js"></script>
<div id="app"></div>
HTML
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ... </head>
<body>
</body>
html {
height: 100%;
}
body {
height: 100%;
background: #212121;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
const root = ReactDOM.createRoot(document.getElementById('app'));
root.render(<h1>Hello, React 18!</h1>);
预览
控制台