don't add empty task

This commit is contained in:
data 2019-06-21 14:44:29 -04:00 committed by notnull
parent df439a2d1f
commit 1222e7794c

View File

@ -70,6 +70,10 @@ class App extends React.Component {
addTask(e) {
e.preventDefault()
if (this.state.newTask === '') {
console.log('Not adding empty task.')
return
}
this.setState({
tasks: this.state.tasks.concat({
id: this.state.tasks.length,