diff --git a/.changeset/old-frogs-run.md b/.changeset/old-frogs-run.md new file mode 100644 index 0000000000..e35ff8bba2 --- /dev/null +++ b/.changeset/old-frogs-run.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Call unref on pathRefs created for move_node to remove memory leak diff --git a/packages/slate-react/src/plugin/with-react.ts b/packages/slate-react/src/plugin/with-react.ts index 395f208ddb..852bc91ebc 100644 --- a/packages/slate-react/src/plugin/with-react.ts +++ b/packages/slate-react/src/plugin/with-react.ts @@ -216,6 +216,8 @@ export const withReact = ( const [node] = Editor.node(e, pathRef.current) NODE_TO_KEY.set(node, key) } + + pathRef.unref() } }