fix(admin-panel): remove duplicate isMountedRef declaration in RichTextEditor
Deploy Canina / deploy (push) Successful in 1m45s
Deploy Canina / deploy (push) Successful in 1m45s
This commit is contained in:
1 parent
c4e3fcda20
commit
79c72517c2
1 file changed
-13
@@ -61,19 +61,6 @@ export default function RichTextEditor({
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
const isMountedRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (editorRef.current) {
|
||||
if (!isMountedRef.current) {
|
||||
editorRef.current.innerHTML = value || '';
|
||||
isMountedRef.current = true;
|
||||
} else if (editorRef.current.innerHTML !== (value || '')) {
|
||||
editorRef.current.innerHTML = value || '';
|
||||
}
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
const exec = (command: string, val: string | undefined = undefined) => {
|
||||
document.execCommand(command, false, val);
|
||||
if (editorRef.current) {
|
||||
|
||||
Reference in new issue
Block a user