diff --git a/src/components/app.js b/src/components/app.js index aab7733..ae60f44 100644 --- a/src/components/app.js +++ b/src/components/app.js @@ -7,8 +7,10 @@ import TodoItem from './todo-item'; @connect(reduce, actions) export default class App extends Component { addTodos = () => { - this.props.addTodo(this.state.text); - this.setState({ text: '' }); + if (this.state.text) { + this.props.addTodo(this.state.text); + this.setState({ text: '' }); + } }; removeTodo = (todo) => {