Giter Site home page Giter Site logo

Comments (13)

bw avatar bw commented on May 26, 2024 1

Hey @ngs — I am still getting this error (on a next.js app). It's unfortunately very sporadic and difficult to reproduce, but when it does happen, I get a setEditorState is not a function .

I'm on

  • draft-js 0.11.6
  • draft-js-markdown-shortcuts-plugin 0.6.1
  • draft-js-plugins-editor 3.0.0
  • markdown-draft-js 2.2.1

Here's the stacktrace:

Unhandled Runtime Error
TypeError: store.setEditorState is not a function

Call Stack
Object.handleBeforeInput
node_modules/draft-js-markdown-shortcuts-plugin/lib/index.js (184:0)
eval
node_modules/draft-js-plugins-editor/lib/Editor/index.js (269:0)
Array.some
<anonymous>
Object.eval [as handleBeforeInput]
node_modules/draft-js-plugins-editor/lib/Editor/index.js (268:0)
editOnBeforeInput
node_modules/draft-js/lib/editOnBeforeInput.js (83:0)
eval
node_modules/draft-js/lib/DraftEditor.react.js (463:0)
HTMLUnknownElement.callCallback
file:///usr/src/app/.next/static/development/dll/dll_f9de5cbc314a1e41f91e.js (440:14)

from draft-js-markdown-shortcuts-plugin.

davidwieler avatar davidwieler commented on May 26, 2024

Yeah, having this exact same problem.

I'll comment back if I find a solution.

@ruoshui-git are you using hooks per chance?

from draft-js-markdown-shortcuts-plugin.

ruoshui-git avatar ruoshui-git commented on May 26, 2024

...
@ruoshui-git are you using hooks per chance?
Yes I am using hooks.

from draft-js-markdown-shortcuts-plugin.

philohelp avatar philohelp commented on May 26, 2024

I have the same error with the autolist plugin and the shortcut plugin. I guess it is related to the last version of react but I dont know exactly how.

from draft-js-markdown-shortcuts-plugin.

davidwieler avatar davidwieler commented on May 26, 2024

I couldn't figure out the issue, and actually dropped DraftJS from my project, switched to SlateJS.

from draft-js-markdown-shortcuts-plugin.

spoeken avatar spoeken commented on May 26, 2024

So, no one knows?

from draft-js-markdown-shortcuts-plugin.

ruoshui-git avatar ruoshui-git commented on May 26, 2024

So, no one knows?

At least I haven't figured it out yet. And I won't be able to work on this for a very long time (like a year).

from draft-js-markdown-shortcuts-plugin.

spoeken avatar spoeken commented on May 26, 2024

It looks like it "just" needs to be refactored to work with hooks.

from draft-js-markdown-shortcuts-plugin.

elbakerino avatar elbakerino commented on May 26, 2024

What Versions are you using?
As I'm using React 16.10, it seem I also need draft-js-plugins-editor:3.0.0 and draft-js:0.11.2

In the plugins editor the handleBeforeInput changed, eventTimeStamp was added.

I opened a pull request #62 that should fix that.

from draft-js-markdown-shortcuts-plugin.

tuzmusic avatar tuzmusic commented on May 26, 2024

I'm not using hooks and I'm having this problem. I also tried the sample code in the Readme and had the same error.
"draft-js": "^0.11.4",
"react": "^16.13.1",
"draft-js-markdown-shortcuts-plugin": "^0.5.0",
"draft-js-plugins-editor": "^3.0.0",

from draft-js-markdown-shortcuts-plugin.

jasuperior avatar jasuperior commented on May 26, 2024

This version doesnt seem to be the one which is on npm 🤦

from draft-js-markdown-shortcuts-plugin.

elbakerino avatar elbakerino commented on May 26, 2024

Still not merged/fixed in the official one, PR is open, in the meantime i published it as draft-js-md-keyboard-plugin

from draft-js-markdown-shortcuts-plugin.

ngs avatar ngs commented on May 26, 2024

Published v0.6.0 that supports draft-js v0.11.x

from draft-js-markdown-shortcuts-plugin.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.