Was recently building similar component to facebook's comment tutorial, so I've picked the same code and realized it lacks callback-based input clearing. So what's the best way to wire that into react/flux architecture?
So _id & name inputs are being cleared independent to success of the form submit.
handleSubmit: function(e) {
e.preventDefault();
var _id = this.refs._id.getDOMNode().value.trim();
var name = this.refs.name.getDOMNode().value.trim();
if (!_id || !name) {
return;
}
this.props.onCommentSubmit({_id: _id, name: name});
this.refs._id.getDOMNode().value = '';
this.refs.name.getDOMNode().value = '';
},