-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgreeting.html
28 lines (26 loc) · 903 Bytes
/
greeting.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>
<title>My First React App</title>
</head>
<body>
<div id="app"></div>
<!-- the 1st 2 scripts render React into a DOM, and the 3rd enables JSX and ES6-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.1.0/umd/react.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.1.0/umd/react-dom.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
<!--enables ES6 to ES5-->
<script type="text/babel">
class Greeting extends React.Component {
render() {
return (
<div>
<h1>Hello {this.props.name}!</h1>
</div>
);
}
}
ReactDOM.render (
<Greeting name="Bloc Student" />, document.getElementById('app')
);
</script>