Browse Source

Listing 19: adding comments - using the custom callback.

Frederic G. MARAND 8 năm trước cách đây
mục cha
commit
54a1dd4320
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      public/scripts/tutorial.js

+ 1 - 1
public/scripts/tutorial.js

@@ -49,7 +49,7 @@ let CommentForm = React.createClass({
     if (!text || !author) {
       return;
     }
-    // TODO send request to the server.
+    this.props.onCommentSubmit({ author: author, text: text });
     this.setState({ author: '', text: '' });
   },
   handleTextChange: function (e) {