* Fixing issue #16067 * Creating reusable Editor component for Editor * fix editor issue * remove log * fix: unit test * fix: unit test * add unit test for the plugin and changes --------- Co-authored-by: unknown <adhabal2002@gmail.com> Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
8 lines
259 B
TypeScript
8 lines
259 B
TypeScript
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
|
|
export default function EditablePlugin({ editable }: { editable: boolean }) {
|
|
const [editor] = useLexicalComposerContext();
|
|
editor.setEditable(editable);
|
|
return null;
|
|
}
|