-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstandalone.html
47 lines (39 loc) · 1.43 KB
/
standalone.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
<html>
<head>
</head>
<body>
<div id='root'></div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.21.1/babel.min.js"></script>
<script type="text/babel">
//the first two script imports give us access to the 'React' and 'ReactDom' objects
// we need the last one to compile our es6 to javascript
// var d = new Date()
// var rocketInteralClock = <h1>The current time is {d.getTime()}</h1>
class RocketComponentList extends React.Component {
render() {
return(
<div>
<img src="https://img.purch.com/w/660/aHR0cDovL3d3dy5zcGFjZS5jb20vaW1hZ2VzL2kvMDAwLzA3NC8yMTIvb3JpZ2luYWwvc3BhY2V4LWZhbGNvbi05LWF0LXZhbmRlbmJlcmcuanBn" />
<p>We have 3 things to buy!</p>
<ol>
<li>Liquid Oxygen (LOX)</li>
<li>Refined Kerosene (RP-1)</li>
<li>Titanium Gridfins</li>
<li>9 Merlin D engines</li>
<li>Lots of C++ Engineers</li>
</ol>
</div>
)
}
}
ReactDOM.render(
// (<h1>Hello Mars</h1>), // you can just put plain html as the first argument and it will get inserted into the root div above
// rocketInteralClock, // you can also use variables
<RocketComponentList />, // and even classes
document.getElementById('root')
)
</script>
</html>