title: How do I export setSearch?
body: <p>Want to be able to access this variable in other components. How do I export the setSearch variable? I have tried a number of syntax variations, and I can't seem to figure it out. As it stands the export setSearch is not working.</p>
  <pre><code>function SearchBar() {
    const [search, setSearch] = useState('');
  
    const handleSubmit = (e) =&gt; {
      e.preventDefault();
      console.log(search);
    };
  
    return (
      &lt;BookSearch onSubmit={handleSubmit}&gt;
        &lt;SearchInput
          type=&quot;text&quot;
          value={search}
          onChange={(e) =&gt; setSearch(e.target.value)}
        &gt;&lt;/SearchInput&gt;
        &lt;SearchButton type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
          Search
        &lt;/SearchButton&gt;
      &lt;/BookSearch&gt;
    );
  }
  
  export setSearch; 
  export default SearchBar;
  </code></pre>