title: The function makes the dependencies of useEffect Hook
body: <p>I have a function that sets my useState when on click, everything works fine but I am getting a warning everytime:</p>
  
  <pre><code> Line 22:  The 'handleClickOpen' function makes the dependencies of useEffect Hook (at line 20) change on every render. To fix this, wrap the 'handleClickOpen' definition into its own useCallback() Hook  react-hooks/exhaustive-deps
  </code></pre>
  
  <p>this is my code:</p>
  
  <pre><code>  useEffect(() =&gt; {
      axios.get("/api/getBlacklist/").then(data =&gt; setBlacklistItems(data.data));
  
      // eslint-disable-next-line
    }, [handleClickOpen]);
  
    function handleClickOpen() {
      setOpen(true);
    }
  </code></pre>
  
  <p>I have tried to replace <code>handleClickOpen</code> in <code>useEffect</code> with just <code>setOpen(true)</code>, but then my page crashes because of too many re-renders.</p>
  
  <p>How to deal with this situation?</p>