mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix: add prefer-dom-node-append rule (#5108)
This commit is contained in:
@@ -106,7 +106,7 @@ export async function bootstrapPluginSystem(
|
||||
const style = document.createElement('style');
|
||||
style.setAttribute('plugin-id', pluginName);
|
||||
style.textContent = text;
|
||||
document.head.appendChild(style);
|
||||
document.head.append(style);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -174,7 +174,7 @@ const EditorWrapper = memo(function EditorWrapper({
|
||||
div.setAttribute('plugin-id', id);
|
||||
const cleanup = editorItem(div, editor);
|
||||
assertExists(parent);
|
||||
document.body.appendChild(div);
|
||||
document.body.append(div);
|
||||
return () => {
|
||||
cleanup();
|
||||
document.body.removeChild(div);
|
||||
@@ -235,7 +235,7 @@ const PluginContentAdapter = memo<PluginContentAdapterProps>(
|
||||
}
|
||||
const div = document.createElement('div');
|
||||
const cleanup = windowItem(div);
|
||||
root.appendChild(div);
|
||||
root.append(div);
|
||||
if (abortController.signal.aborted) {
|
||||
cleanup();
|
||||
root.removeChild(div);
|
||||
|
||||
@@ -25,7 +25,7 @@ export const PluginHeader = () => {
|
||||
div.setAttribute('plugin-id', pluginName);
|
||||
startTransition(() => {
|
||||
const cleanup = create(div);
|
||||
root.appendChild(div);
|
||||
root.append(div);
|
||||
addCleanup(pluginName, () => {
|
||||
pluginsRef.current = pluginsRef.current.filter(
|
||||
name => name !== pluginName
|
||||
|
||||
Reference in New Issue
Block a user