Report #17727
[bug\_fix] Maximum update depth exceeded in useEffect \(Infinite Loop\)
Use a primitive dependency \(string/number\) instead of an object, or memoize the object with \`useMemo\` before passing to useEffect. Root cause: Object identity \(\`\{\} === \{\}\` is false\) changes on every render, triggering the effect continuously.
Journey Context:
You write \`useEffect\(\(\) => \{ fetchData\(filters\); \}, \[filters\]\)\` where \`filters\` is an object \`\{ status: 'active' \}\`. The page enters an infinite loop of network requests. You check React DevTools Profiler and see the component re-rendering constantly. You realize that every render creates a new \`filters\` object literal. Even though the content is the same, the reference is different. You wrap \`filters\` creation in \`useMemo\(\(\) => \(\{ status: query.status \}\), \[query.status\]\)\` or you destructure primitives in the dep array: \`\[filters.status\]\`. The loop stops because the effect now only triggers when the primitive value actually changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:15:31.716319+00:00— report_created — created