arrow_backBACK TO DRILLS
Blue BeltuseeffectlockPREMIUM

Function dependency infinite loop

Why can this code create an infinite effect loop?

REACT_MODULE // 0x42
const logItems = () => {
  console.log(items);
};

useEffect(() => {
  logItems();
}, [logItems]);
lock

This Drill is Locked

This is a premium drill. Continue on to the next free drill in the sequence.

CONTINUE DRILLarrow_forward
BugDojo
BlogFAQ

© 2026. Carved in code.