jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.4k stars 1.16k forks source link

handleReturn not working #1148

Open mikmiksai opened 3 years ago

mikmiksai commented 3 years ago

Hi, I'm using Typescript in React and I'm getting this error.

const myHandleReturn = () => {
    console.log("test")
  }
  return (
    <div className="container">
      <p>Create blog</p>
      <input />
      <Editor
        editorState={editorState}
        wrapperClassName="wrapper-class"
        editorClassName="editor-class"
        toolbarClassName="toolbar-class"
        onEditorStateChange={handleChangeEditor}
        handleReturn={myHandleReturn}
        toolbar={{
          options: ["emoji", "link", "image"],
          image: { uploadEnabled: true, previewImage: true },
        }}
      />
      <button onClick={postBlog}>Post Blog</button>
    </div>
  );

image

vlkpa commented 3 years ago

same as you, any update?

mikmiksai commented 3 years ago

@vlkpa , sorry no update

entozoon commented 2 years ago

It's missing a type definition. I've created a PR for it as you can see above, but in the meantime a cheeky workaround:

// @ts-ignore
handleReturn={(