eslint-plugin-react-hooks version: 4.6.0
Example code:
import { useCallback } from "react";
import { useFetcher } from "react-router-dom";
...
const fetcher = useFetcher();
const onClick = useCallback(() => fetcher.submit(XXX), [fetcher.submit]);
// warning React Hook useCallback has a missing dependency: 'fetcher'. Either include it or remove the dependency array react-hooks/exhaustive-deps
This is the recommended way of specifying the dependency for this method, see remix-run/react-router#10336.
Expected
There's no warning.
Thanks!