mirror of
https://github.com/zhigang1992/reactfire.git
synced 2026-04-23 04:00:23 +08:00
Update app.js
Adding event.preventDefault(); to the handleSubmit method prevents the browser from submitting the form via standard mechanisms in turn engaging and demonstrating React mechanisms.
This commit is contained in:
@@ -29,6 +29,7 @@ var CommentList = React.createClass({
|
||||
|
||||
var CommentForm = React.createClass({
|
||||
handleSubmit: function() {
|
||||
event.preventDefault();
|
||||
var author = this.refs.author.getDOMNode().value.trim();
|
||||
var text = this.refs.text.getDOMNode().value.trim();
|
||||
this.props.onCommentSubmit({author: author, text: text});
|
||||
|
||||
Reference in New Issue
Block a user