diff --git a/docs/tutorial.md b/docs/tutorial.md index 6b771aeba..882d2ad41 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -565,6 +565,9 @@ var CommentForm = React.createClass({ handleSubmit: function() { var author = this.refs.author.getDOMNode().value.trim(); var text = this.refs.text.getDOMNode().value.trim(); + if (!text || !author) { + return false; + } this.props.onCommentSubmit({author: author, text: text}); this.refs.author.getDOMNode().value = ''; this.refs.text.getDOMNode().value = '';