Fixed console error when unmounting ckeditor

This commit is contained in:
Colin Dawson 2026-02-01 22:47:33 +00:00
parent 9565b80fb1
commit fb595a16bf

View File

@ -369,12 +369,12 @@ export default function TextEditor(props) {
);
}}
onAfterDestroy={() => {
Array.from(editorToolbarRef.current.children).forEach(
(child) => child.remove(),
);
Array.from(editorMenuBarRef.current.children).forEach(
(child) => child.remove(),
);
Array.from(
editorToolbarRef.current?.children || [],
).forEach((child) => child.remove());
Array.from(
editorMenuBarRef.current?.children || [],
).forEach((child) => child.remove());
}}
editor={DecoupledEditor}
config={editorConfig}