title: React JS - Why do I need to assign e.target to a const to use e.target.value?
body: <p>Doing some practice in React JS and noticed I need to assign e.target to a variable before being able to use it - but why? The first code snippet gives me the error: "TypeError: Cannot read property 'input' of null".
  I am confused.</p>
  
  <pre><code>handleSubmit = (e) =&gt; {
          e.preventDefault()
          console.log("Added")
          this.setState((prevState) =&gt; {
              return {
                  items: prevState.items.concat([e.target.input.value]) // does not work
              }
          })
      }
  </code></pre>
  
  <pre><code>handleSubmit = (e) =&gt; {
          e.preventDefault()
          console.log("Added")
          const target = e.target
          this.setState((prevState) =&gt; {
              return {
                  items: prevState.items.concat([target.input.value]) // This works. Why?
              }
          })
      }
  </code></pre>