@samitouri / QOS-React-2 / commits / 6c926094c3

Including missing validation check

The validation check was removed from the update to the CommentForm handleSubmit function.

Michael Randers-Pehrson committed Aug 21, 2014 at 23:00 UTC 6c926094c3c0ee5ea1b1b5d0811fe65e613003d9
1 file changed +3
docs/docs/tutorial.md
+3
@@ -565,6 +565,9 @@ var CommentForm = React.createClass({
565 handleSubmit: function() {
566 var author = this.refs.author.getDOMNode().value.trim();
567 var text = this.refs.text.getDOMNode().value.trim();
568 + if (!text || !author) {
569 + return false;
570 + }
571 this.props.onCommentSubmit({author: author, text: text});
572 this.refs.author.getDOMNode().value = '';
573 this.refs.text.getDOMNode().value = '';