fix(examples/todo): don't submit empty values (#10979)

This commit is contained in:
Pooya Parsa
2017-09-30 08:20:01 -07:00
committed by Brian Vaughn
parent f2568605a7
commit 2e2dc6708f
+3
View File
@@ -26,6 +26,9 @@ class TodoApp extends React.Component {
handleSubmit(e) {
e.preventDefault();
if (!this.state.text.length) {
return;
}
var newItem = {
text: this.state.text,
id: Date.now()