mirror of
https://github.com/paperclipai/paperclip
synced 2026-03-25 11:21:48 +00:00
MarkdownEditor's plugins useMemo depended on imageUploadHandler, which was a new arrow function on every parent render. This caused MDXEditor to reinitialize plugins on each render, firing onChange, which updated the overlay state in AgentConfigForm, triggering a parent re-render — creating an infinite "Maximum update depth exceeded" loop. Fix: use a stable ref for imageUploadHandler so plugins are only created once (keyed on whether a handler exists, not its identity). Also use a module-level empty object for env config fallback to avoid unnecessary EnvVarEditor re-renders. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>