mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
fix: add prefer-dom-node-remove rule (#5112)
This commit is contained in:
@@ -177,7 +177,7 @@ const EditorWrapper = memo(function EditorWrapper({
|
||||
document.body.append(div);
|
||||
return () => {
|
||||
cleanup();
|
||||
document.body.removeChild(div);
|
||||
div.remove();
|
||||
};
|
||||
});
|
||||
});
|
||||
@@ -238,11 +238,11 @@ const PluginContentAdapter = memo<PluginContentAdapterProps>(
|
||||
root.append(div);
|
||||
if (abortController.signal.aborted) {
|
||||
cleanup();
|
||||
root.removeChild(div);
|
||||
div.remove();
|
||||
} else {
|
||||
const cl = () => {
|
||||
cleanup();
|
||||
root.removeChild(div);
|
||||
div.remove();
|
||||
};
|
||||
const dispose = addCleanup(pluginName, cl);
|
||||
abortController.signal.addEventListener('abort', () => {
|
||||
|
||||
@@ -30,7 +30,7 @@ export const PluginHeader = () => {
|
||||
pluginsRef.current = pluginsRef.current.filter(
|
||||
name => name !== pluginName
|
||||
);
|
||||
root.removeChild(div);
|
||||
div.remove();
|
||||
cleanup();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user