title: How event.target.name.value works
body: <p>So i've been trying to use event.target.name.value for an input field but when i submit the form, the values are null and i have to click twice to get the values. Here is my code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const [name, setName] = useState('');
  const handleSubmit = (event)=&gt; {
    setName = event.target.name.value;
    console.log(name);
  }</code></pre>
  </div>
  </div>
  </p>
  <p>What am i doing wrong?</p>