UNPKG

@yuntijs/ui

Version:

☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps

13 lines 554 B
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'; import { useEffect } from 'react'; export var EditablePlugin = function EditablePlugin(_ref) { var editable = _ref.editable; var _useLexicalComposerCo = useLexicalComposerContext(), _useLexicalComposerCo2 = _slicedToArray(_useLexicalComposerCo, 1), editor = _useLexicalComposerCo2[0]; useEffect(function () { editor.setEditable(editable); }, [editable, editor]); return null; };