react-hooks/memoized-effect-dependencies
Require the dependencies of an effect to be memoized
Also called react_hooks/memoized-effect-dependencies, react/memoized-effect-dependencies
An object or function that's created during render is new every time, so an effect that depends on it runs after every render. React Compiler has a check for that.
bun lint doesn't run that check, so this rule reports nothing. It exists because eslint-plugin-react-hooks has a rule with this name, and a config that names it needs to keep working.
Examples#
example.jsxNo problems
import { useEffect } from "react";
function Chat({ roomId }) {
const options = { roomId };
useEffect(() => {
connect(options);
}, [options]);
}