githubnext/chopinPublic

Let's compose rich plans together

Fix dependency suppression in collaboration bind Effect

The Effect that binds MDXEditor's Lexical instance to the shared Yjs
document suppressed react-hooks/exhaustive-deps to read `options`
without re-running the bind on every render. Suppressing the rule
instead of using the ref pattern hides real dependency changes and
risks stale closures if the effect body grows.

Replace the suppression with an `optionsRef` that is written on every
render and read inside the effect at bind and unbind time. This keeps
the effect's only true dependency (`editor`) explicit while still
reading the latest onProvider/onBinding callbacks and user identity,
preserving existing behavior exactly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
COGAgithub-actions[bot] and Copilot authored committed by GitHub
ba36f80Patch
Parent4f55e2e
1 file changed+14-5
StackedSplit
packages/editor/src/collaboration.tsx+14 −5