'using rich-markdown-editor react

I am trying to use rich-markdown-editor to get values but the method am using is not modular. Can someone suggest a better way. I have tried both onChange and onSave but cannot seem to get them to work.According to their documentation

onSave({ done: boolean }): void This callback is triggered when the user explicitly requests to save using a keyboard shortcut, Cmd+S or Cmd+Enter. You can use this as a signal to save the document to a remote server.

onChange(() => value): void This callback is triggered when the contents of the editor changes, usually due to user input such as a keystroke or using formatting options. You may use this to locally persist the editors state.

import React, { useState } from "react";
import Editor from "rich-markdown-editor";

const Whiteboard = () => {
  const [content, setContent] = useState("");

  return (
    <div>
      <div>
        <h1>Your Content</h1>
        <Editor id="123" value={content} onChange={setContent} />
      </div>
      {content}
    </div>
  );
};

export default Whiteboard;


Solution 1:[1]

Try

<Editor id="123" value={content} onChange={(value) => setContent(value()} />

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Doylet