-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
48 lines (44 loc) · 1.31 KB
/
index2.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
47
48
<!-- INSERT BOILER PLATE CODE -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- REACT LIBRARY -->
<script src="https://unpkg.com/[email protected]/dist/react.js"></script>
<!-- REACT DOM LIBRARY -->
<script src="https://unpkg.com/[email protected]/dist/react-dom.js"></script>
<!-- BABEL LIBRARY -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.25.0/babel.min.js"></script>
<title>Class Components Props</title>
</head>
<body>
<!-- DESIGNATED LOCATION TO INSERT REACT CONTENT -->
<div id="app">React has not rendered yet</div>
<!-- JAVASCRIPT -->
<script type="text/babel">
class PersonGreeting extends React.Component {
render() {
var personStyle = {
height: 300,
width: 300,
backgroundColor: this.props.color
}
return(
<div style={personStyle}>Hello, {this.props.name}!</div>
);
}
}
ReactDOM.render(
<div>
<PersonGreeting color="tomato" name="Jimmy"/>
<PersonGreeting color="blue" name="Billy"/>
<PersonGreeting color="green" name="Sarah"/>
</div>
,
document.getElementById("app")
);
</script>
</body>
</html>