title: How do I use 'useEffect' in React 18
body: <p>I'm following a youtube tutorial, and the tutorial is using React 17 and I'm using React 18.  I'm at a section where we're formatting some animated text, everything is working OK, but the part I'm on is setting the letters  of the sentence to change on hover.  I'm getting the following error:</p>
  <p>react-dom.development.js:86 Warning: useEffect must not return anything besides a function, which is used for clean-up. You returned: 2</p>
  <p>Here's the snip of code that is giving me issues:</p>
  <pre><code>  useEffect(() =&gt; {
      return setTimeout(() =&gt; {
        setLetterClass('text-animate-hover')
      }, 4000)
    }, [])
  </code></pre>
  <p>Here is my scss for the text-animate-hover class:</p>
  <pre><code>  .text-animate-hover {
      min-width: 10px;
      display: inline-block;
      animation-fill-mode: both;
  
      &amp;:hover {
        animation: rubberBand 1s;
        color: #ffd700;
      }
    }
  </code></pre>
  <p>I'm reading that I don't need to use 'useEffect' with React 18, but I'm not understanding what I should be doing instead. Most of the searching I've done has returned a lot of instances using 'useEffect' with 'async' issues, which I'm having trouble relating those to my specific issue.</p>
  <p>I appreciate any help with this.</p>
  <p>-N8</p>