title: React Hook useCallback has a missing dependency. Either include it or remove the dependency array react-hooks/exhaustive-deps
body: <p>I used <code>useEffect</code> in my component in order to execute an async function.</p>
  
  <pre><code> useEffect(() =&gt; {
      scoreRequest(answers);
    }, [answers]);
  </code></pre>
  
  <p>Then I get this warning:</p>
  
  <pre><code>React Hook useCallback has a missing dependency: 'scoreRequest'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  
  </code></pre>
  
  <p>I used the <code>useCallback</code> to avoid this warning:</p>
  
  <pre><code>const getScore = useCallback(() =&gt; {
    scoreRequest(answers);
    }, [answers]);
  
    useEffect(() =&gt; {
      scoreRequest(answers);
    }, [answers]);
  
  </code></pre>
  
  <p>But still got the same error. However, I found a similar <a href="https://stackoverflow.com/questions/55840294/how-to-fix-missing-dependency-warning-when-using-useeffect-react-hook">question</a> and it's mentioned in the answer either to declare the function into the useEffect  or I could disable the rule.
  The function <code>scoreRequest()</code> declared in another file and I don't want to mix it with my component.</p>
  
  <pre><code>export const scoreRequest = (answers: IAnswer[]): ThunkAction&lt;void, AppState, null, Action&lt;string&gt;&gt; =&gt; {
    return async (dispatch: Dispatch) =&gt; {
      dispatch(startScoreRequest());
      getScoreApi(answers).then((response: AxiosResponse) =&gt; {
        const { data } = response;
        const answer = {
          scoreLabel: data.message,
          userScore: data.result.userScore,
          totalScore: data.result.totalScore,
          emoji: data.result.emoji,
          scoreLabelColor: data.result.scoreLabelColor
        };
        dispatch(successScore(answer));
      }, (error: AxiosError) =&gt; {
        let errorMessage = "Internal Server Error";
        if (error.response) {
          errorMessage = error.response.data.error;
        }
        dispatch(failScore(errorMessage));
        dispatch(errorAlert(errorMessage));
      });
    };
  };
  </code></pre>
  
  <p>Is it any solution to fix this warning?</p>