AI is weirdly confident about React hooks. Ask for “extract the data fetching into a custom hook” and you’ll get something that looks idiomatic: useSomething , a useEffect , a couple of useMemo s, maybe a useCallback for good measure. Types pass. The demo works once. Then you merge and discover the effect fires twice on every keystroke, or the cleanup never ran, or the hook is just a wrapper around three lines that didn’t need a name.
I treat AI-suggested hooks like AI-suggested refactors: useful drafts, not mergeable by default. Here’s the smell checklist I run before I accept the branch.
Smell 1: useEffect dependency lies
The model loves this pattern:
useEffect (() => { fetchUser ( userId ). then ( setUser ); }, []); // "run once on mount"
Enter fullscreen mode
Exit fullscreen mode
Except userId changed three routes ago, and the effect still holds the first id. Or the opposite lie:
useEffect (() => { analytics . track ( " view " , { id : item .…