Skip to content

Commit b0e4b3a

Browse files
author
Matt Calthrop
committed
Add tutorial2-3
1 parent d9931da commit b0e4b3a

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

public/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<body>
1515
<div id="content"></div>
1616
<!--<script type="text/babel" src="scripts/example.js"></script>-->
17-
<script type="text/babel" src="scripts/tutorial1.js"></script>
17+
<!--<script type="text/babel" src="scripts/tutorial1.js"></script>-->
18+
<script type="text/babel" src="scripts/tutorial2-3.js"></script>
1819
</body>
1920
</html>

public/scripts/tutorial2-3.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* global React, ReactDOM */
2+
3+
var CommentList = React.createClass({
4+
render: function() {
5+
return (
6+
<div className="commentList">
7+
Hello, world! I am a CommentList.
8+
</div>
9+
);
10+
}
11+
});
12+
13+
var CommentForm = React.createClass({
14+
render: function() {
15+
return (
16+
<div className="commentForm">
17+
Hello, world! I am a CommentForm.
18+
</div>
19+
);
20+
}
21+
});
22+
23+
var CommentBox = React.createClass({
24+
render: function() {
25+
return (
26+
<div className="commentBox">
27+
<h1>Comments</h1>
28+
<CommentList />
29+
<CommentForm />
30+
</div>
31+
);
32+
}
33+
});
34+
35+
ReactDOM.render(
36+
<CommentBox />,
37+
document.getElementById('content')
38+
);

0 commit comments

Comments
 (0)