Removing the annoying "exhaustive-deps" warning in React

React JS

If you see this warning:

  Line 47:7:  React Hook useEffect has a missing dependency: '...'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

Then, to remove it, edit you package.json and set this:


"eslintConfig": {
    "extends": "react-app",
    "rules": {
      "react-hooks/exhaustive-deps": "off"
    }
  }

Post a Comment

Previous Post Next Post