Files
2026-02-25 22:13:10 +08:00

18 lines
451 B
TypeScript

import type { LexicalEditor } from 'lexical'
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
import { useEffect } from 'react'
type CaptureEditorPluginProps = {
onReady: (editor: LexicalEditor) => void
}
export const CaptureEditorPlugin = ({ onReady }: CaptureEditorPluginProps) => {
const [editor] = useLexicalComposerContext()
useEffect(() => {
onReady(editor)
}, [editor, onReady])
return null
}