@ai-stack/payloadcms
Version:
<p align="center"> <img alt="Payload AI Plugin" src="assets/payload-ai-intro.gif" width="100%" /> </p>
16 lines (15 loc) • 463 B
JavaScript
export const setSafeLexicalState = (state, editorInstance, action = 'replace')=>{
try {
const editorState = editorInstance.parseEditorState(state);
if (editorState.isEmpty()) {
return;
}
editorInstance.setEditorState(editorState);
} catch (error) {
console.error('Error setting editor state: ', {
error,
state
});
}
};
//# sourceMappingURL=setSafeLexicalState.js.map