Add initial data to Lexical editor #5278
-
|
Hi, In the below code, I'm trying to show the Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I tried out your code and seems that the problem is that const editorConfig: any = {
editorState: () => value,
onError(error: Error) {
throw error;
},
theme: exampleTheme,
nodes: [
HeadingNode,
ListNode,
ListItemNode,
QuoteNode,
CodeNode,
CodeHighlightNode,
AutoLinkNode,
LinkNode,
],
};also, your example state seems to be empty. I tried another one to test
|
Beta Was this translation helpful? Give feedback.
I tried out your code and seems that the problem is that
editorStateineditorConfigshould be a string and not a function, so changing to this does the trickalso, your example state seems to be empty. I tried another one to test
{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"This is a test","type":"text","version":1}],"direction":"ltr","…