-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.html
46 lines (35 loc) · 1.17 KB
/
react.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<head>
<title>react</title>
<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 src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
<div id="app"></div>
<script type="text/babel">
class Hello extends React.Component{
render(){
return(
<h1>Hello {this.props.name}!</h1>
);
}
}
class App extends React.Component {
render(){
return (
<div>
<Hello name="harry"/>
<Hello name="david"/>
<Hello/>
<Hello/>
<h1>welcome</h1>
Hello world!</div>
);
}
}
ReactDOM.render(<App/>, document.querySelector('#app'));
</script>
</body>
</html>