html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>React app (created by Calvin) 2021</title>
</head>
<body>
<pre id="test"></pre>
<div id="app"><div class="text-center">Loading ....</div></div>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
</script><script type="text/babel">
const {useState, useEffect} = React;
const App = () => {
const [ title ] = useState('React app (created by Calvin)')
const [ data, setData ] = useState(0);
const [ str, setStr ] = useState('a');
const [ obj, setObj ] = useState({d:0});
const [ arr, setArr ] = useState([{d:0}]);
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run