fix: add prefer-dom-node-remove rule (#5112)

This commit is contained in:
LongYinan
2023-11-29 04:43:50 +00:00
parent 45690c2756
commit 4dddbbdaee
6 changed files with 8 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ export const RootBlockHub = () => {
const div = ref.current;
if (blockHub) {
if (div.hasChildNodes()) {
div.removeChild(div.firstChild as ChildNode);
(div.firstChild as ChildNode).remove();
}
div.append(blockHub);
}

View File

@@ -136,7 +136,7 @@ const BlockSuiteEditorImpl = ({
}
container.append(editor);
return () => {
container.removeChild(editor);
editor.remove();
};
}, [editor]);