Преглед изворни кода

Listing 2: Composing components: adding CommentList, CommentForm.

Frederic G. MARAND пре 8 година
родитељ
комит
039b8299fc
1 измењених фајлова са 20 додато и 0 уклоњено
  1. 20 0
      public/scripts/tutorial.js

+ 20 - 0
public/scripts/tutorial.js

@@ -1,3 +1,23 @@
+let CommentList = React.createClass({
+  render: function () {
+    return (
+      <div className="commentList">
+        Hello, world! I am a CommentList.
+        </div>
+    );
+  }
+});
+
+let CommentForm = React.createClass({
+  render: function () {
+    return (
+      <div className="commentForm">
+        Hello, world! I am a CommentForm.
+        </div>
+    );
+  }
+});
+
 let CommentBox = React.createClass({
   render: function () {
     return (