title: Creating a Upvote Component as a Functional Component
body: <p>So I am practicing changing my Upvote class component to a functional component. Below is my work in progress. Ultimately I would like to handle the upvote/downvote changes through one onClick handler. Please let me know what I need to change in my code in order to do so. Thanks!</p>
  <pre><code>import React, { useState } from 'react';
  
  const Upvote = () =&gt; {
      const [count, setCount] = useState(0);
  
      const handleClick = () =&gt; {
          if (count === 0){
              setCount(0) 
          } else if (count === 1){
              &lt;span&gt;{decrement}&lt;/span&gt;
          } else {
              &lt;span&gt;{increment}&lt;/span&gt;
          }
  
      }
  
      const increment = () =&gt; {
          setCount(count + 1)
      }
  
      const decrement = () =&gt; {
          setCount(count - 1)
      }
  
      return (
          &lt;div&gt;
              &lt;button onClick={handleClick}&gt;
                  {count}
              &lt;/button&gt;
          &lt;/div&gt;
      )
  }
  
  export default Upvote;
  </code></pre>