diff --git a/src/Editor.tsx b/src/Editor.tsx index 46fca25..b166419 100644 --- a/src/Editor.tsx +++ b/src/Editor.tsx @@ -70,7 +70,7 @@ const Editor = ({ }: IEditorProps) => { const [editor] = useLexicalComposerContext(); const [activeEditor, setActiveEditor] = useState(editor); - + const [_isEditable, setIsEditable] = useState(isEditable); const editorStateRef = useRef(null); const { historyState } = useSharedHistoryContext(); const { @@ -83,8 +83,10 @@ const Editor = ({ useEffect(() => { editor.setEditable(isEditable); + setIsEditable(isEditable); + if (locale) i18n.changeLanguage(locale); - }, []); + }, [isEditable]); return ( - + {_isEditable && }