import React from 'react'
import { connect } from 'react-redux'
import { addTodo } from '../actions'

let AddTodo = ({ dispatch }) => {
  let input

  return (
    <div>
      <form onSubmit={e => {
        e.preventDefault()
        if(input.value.trim())
          dispatch(addTodo(input.value))
        input.value = ''
      }}>
        <input ref={node => {
          input = node
        }} />
        <button type="submit">
          Add Todo
        </button>
      </form>
    </div>
  )
}
AddTodo = connect()(AddTodo)

export default AddTodo

@@ -229,16 +229,17 @@
       if
+ 
 (input.v
@@ -250,16 +250,18 @@
 .trim())
+ %7B
 %0A       
@@ -294,16 +294,26 @@
 value))%0A
+        %7D%0A
         

Update AddTodo.js