title: Accessing context from useEffect
body: <p>I have a context that is used to show a full page spinner while my application is performing long running tasks.</p>
  
  <p>When I attempt to access it inside <code>useEffect</code> I get a the <code>react-hooks/exhaustive-deps</code> ESLint message.  For example the following code, although it works as expected, states that <code>busyIndicator</code> is a missing dependency:</p>
  
  <pre><code>const busyIndicator = useContext(GlobalBusyIndicatorContext);
  
  useEffect(() =&gt; {
      busyIndicator.show('Please wait...');
  }, []);
  </code></pre>
  
  <p><a href="https://overreacted.io/a-complete-guide-to-useeffect/" rel="noreferrer">This</a> article suggests that I could wrap the function with <code>useCallback</code> which might look as follows:</p>
  
  <pre><code>const busyIndicator = useContext(GlobalBusyIndicatorContext);
  const showBusyIndicator = useCallback(() =&gt; busyIndicator.show('Please wait...'), []);
  
  useEffect(() =&gt; {
      showBusyIndicator();
  }, [showBusyIndicator]);
  </code></pre>
  
  <p>Although this works it has moved the issue to the <code>useCallback</code> line which now complains about the missing dependency.</p>
  
  <p>Is it ok to ignore the ESLint message in this scenario or am I missing the something?</p>