title: ERROR: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array
body: <p>Trying to dispatch an action but i got this error in my terminal.</p>
  <blockquote>
  <p>ERROR: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array</p>
  </blockquote>
  <p>yet my code wont render on the screen.</p>
  <pre class="lang-js prettyprint-override"><code>function CartPage(props) {
    const dispatch = useDispatch();
    const [Total, setTotal] = useState(0);
    const [ShowTotal, setShowTotal] = useState(false);
    const [ShowSuccess, setShowSuccess] = useState(false);
  
    useEffect(() =&gt; {
      let cartItems = [];
      if (props.user.userData &amp;&amp; props.user.userData.cart) {
        if (props.user.userData.cart.length &gt; 0) {
          props.user.userData.cart.forEach((item) =&gt; {
            cartItems.push(item.id);
          });
          dispatch(getCartItems(cartItems, props.user.userData.cart)).then(
            (response) =&gt; {
              if (response.payload.length &gt; 0) {
                calculateTotal(response.payload);
              }
            },
          );
        }
      }
    }, [props.user.userData]);
  }
  </code></pre>