title: Why this onChange function works?
body: <p>I am now confused about the onChange event handler. I just want to knows how it works.
  Traditionally if we want to keep track of value inside the input box or text area we pass a variable to the function.</p>
  <pre><code>&lt;InputDialogContent
    inputLabel=&quot;Email Address&quot;
    inputType=&quot;email&quot;
    onChange={(ev: React.ChangeEvent&lt;HTMLTextAreaElement&gt;): any =&gt;
      onInputChange(ev.target.value)
    }
  /&gt;
  </code></pre>
  <p>In this case we are passing in <code>ev.target.value</code></p>
  <p>and the function is</p>
  <pre><code>function onInputChange(input: any) {
    if (isValidEmail(input)) {
      setEnableLoginButton(true);
    } else {
      setEnableLoginButton(false);
    }
  }
  </code></pre>
  <p>it works fine. I know that The <code>ev.target.value</code> become <code>input</code>
  But one of my senior change the code into something like this and is still working.
  I am wondering why its is working when it doesn't pass a variable like the above function</p>
  <pre><code>&lt;InputDialogContent
    inputLabel=&quot;Email Address&quot;
    inputType=&quot;email&quot;
    onChange={onInputChange}
  /&gt;
  </code></pre>
  <p>the function  become like this. From what i see the function still expecting an variable to be passed into but there is no variable being passed. &amp;&amp; THIS FUNCTION STILL WORKS. <strong>WHY ?</strong></p>
  <pre><code>function onInputChange(e: React.ChangeEvent&lt;HTMLTextAreaElement&gt;) {
    setEnableLoginButton(isValidEmail(e.target.value));
  }
  
  const isValidEmail = (email: string): boolean =&gt; {
    const validateFormat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
    if (email.match(validateFormat)) {
      return true;
    } else {
      return false;
    }
  };
  </code></pre>
  <p>I am using typescript and its a function component.</p>