title: How to pass function with React Hooks?
body: <p>How can I pass function with React Hooks? I've used useCallback, but it shows an error that it is not a function.</p>
  
  <p>In class component I was doing it like this:</p>
  
  <pre><code>hidePopUp = (event) =&gt; {
      event.preventDefault();
      this.setState({
          popup: !this.state.popup
      })
  }
  </code></pre>
  
  <p>Then I was passing function:</p>
  
  <pre><code>&lt;Popup hidePopUp={this.hidePopUp}/&gt;
  </code></pre>
  
  <p>That's my problem with Hooks:</p>
  
  <pre><code>const hidePopup = useCallback(
      (event) =&gt; {
          event.preventDefault();
          setPopup(!popup);
      }, []
  );
  
  &lt;Popup hidePopup={() =&gt; hidePopup}/&gt;
  </code></pre>
  
  <p>And this is my button in Popup component:</p>
  
  <pre><code>&lt;button onClick={(event)=&gt;this.props.hidePopUp(event)}&gt;&lt;/button&gt;
  </code></pre>