Skip to content
Discussion options

You must be logged in to vote

I tried out your code and seems that the problem is that editorState in editorConfig should be a string and not a function, so changing to this does the trick

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

{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"This is a test","type":"text","version":1}],"direction":"ltr","…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rkeerthient
Comment options

Answer selected by rkeerthient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants