-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3.3JSX.html
32 lines (31 loc) · 1.05 KB
/
3.3JSX.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
29
30
31
32
<!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>Document</title>
</head>
<body>
<div id="root"></div>
<script src="https://unpkg.com/react@16.13.1/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.13.1/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone@7.8.3/babel.js"></script>
<script type="text/babel">
const rootElement = document.getElementById("root")
const name = "Tim"
const className = "container"
const props = {
className: "container-test",
onClick: () => console.log("Hello, everyone!")
}
const element = <div className={className} {...props}>
<h1 className="hello-react-text">Welcome {name}!</h1>
</div>
ReactDOM.render(
element,
rootElement
)
</script>
</body>
</html>