import { jsx as _jsx } from "react/jsx-runtime";
import { OnChangePlugin as LexicalOnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
import { $generateHtmlFromNodes } from '@lexical/html';
const OnChangePlugin = (props) => {
    // PROPS
    const { onChange } = props;
    const handleChange = (editorState, editor) => {
        editorState.read(() => {
            const htmlString = $generateHtmlFromNodes(editor);
            onChange(htmlString);
        });
    };
    return _jsx(LexicalOnChangePlugin, { onChange: handleChange });
};
export default OnChangePlugin;
