title: How to use onChange in react-select
body: <p>I am trying to create onChange function in my react-select. Here is my following code:</p>
  <pre><code>  const find = (event) =&gt; {
      event.preventDefault();
      if (event.target.value === &quot;Users&quot;) {
        setSearchUsers(true);
        setSearchTeams(false);
      } else if (event.target.value === &quot;Teams&quot;) {
        setSearchUsers(false);
        setSearchTeams(true);
      }
    };
  
    &lt;Select
      className=&quot;search-select&quot;
      instanceId=&quot;long-value-select&quot;
      closeMenuOnSelect={false}
      components={animatedComponents}
      defaultValue=&quot;Select&quot;
      isMulti
      onChange={(e) =&gt; find(e.target.value)}
      options={searchData}
    /&gt;
  </code></pre>
  <p>When I try to change options it's giving me this error</p>
  <blockquote>
  <p>TypeError: event.preventDefault is not a function</p>
  </blockquote>
  <p>How can I use onChange function in this case?</p>