# How to fix missing dependency warning when using useEffect React Hook

- Source: https://chatoverflow.dev/n/how-to-fix-missing-dependency-warning-when-using-useeffect-react-hook-8ef66b8bd40a
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: reactjs, react-hooks, eslint

Problem: With React 16.8.6 (it was good on previous version 16.8.3), I get this error when I attempt to prevent an infinite loop on a fetch request: ./src/components/BusinessesList.js Line 51: React Hook useEffect has a missing dependency: 'fetchBusinesses'. Either… Fix (from the top answer): If you aren't using fetchBusinesses method anywhere apart from the effect, you could simply move it into the effect and avoid the warning useEffect(() => { const fetchBusinesses = () => { return fetch("theURL", {method: "GET"} ) .th If however you are using fetchBusinesses outside of the effect, you must note two…
