mirror of
https://github.com/khoaliber/paperclip.git
synced 2026-04-21 17:09:39 +00:00
69ba77f334
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>