-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathReact_HTML_Demo.html
44 lines (37 loc) · 1.11 KB
/
React_HTML_Demo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>React Demo</title>
<script src="https://npmcdn.com/[email protected]/dist/react.js"></script>
<script src="https://npmcdn.com/[email protected]/dist/react-dom.js"></script>
<script src="https://npmcdn.com/[email protected]/browser.min.js"></script>
</head>
<body>
<div id="demo">
</div>
<script type="text/babel">
var BasicReactDemoComponent = React.createClass({
render: function() {
return (
<div>
<p> <h2>
It is {this.props.date.toTimeString()} <br/><br/>
<span>Demo component using react! </span><br/><br/>
<span>See Datetime is refreshing,
but this "{this.props.myText}" text is not refreshing.</span>
</h2>
</p>
</div>
);
}
});
setInterval(function() {
ReactDOM.render(
<BasicReactDemoComponent date={new Date()} myText={'Awesome Appirio, Salesforce and Facebook!!!'}/>,
document.getElementById('demo')
);
}, 500);
</script>
</body>
</html>