Comments (13)
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.
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 are you using hooks per chance?
Yes I am using hooks.
from draft-js-markdown-shortcuts-plugin.
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.
I couldn't figure out the issue, and actually dropped DraftJS from my project, switched to SlateJS.
from draft-js-markdown-shortcuts-plugin.
So, no one knows?
from draft-js-markdown-shortcuts-plugin.
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.
It looks like it "just" needs to be refactored to work with hooks.
from draft-js-markdown-shortcuts-plugin.
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.
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.
This version doesnt seem to be the one which is on npm 🤦
from draft-js-markdown-shortcuts-plugin.
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.
Published v0.6.0 that supports draft-js v0.11.x
from draft-js-markdown-shortcuts-plugin.
Related Issues (19)
- Configure which markdown's are allowed
- Expansion when selected
- Conflicts with emoji plugin/mention plugin? HOT 4
- Code block seems can't be end HOT 3
- Breaks on latest Draft-JS-Plugins release :( (getEditorState is not a function) HOT 4
- Incompatibility with create-react-app? HOT 6
- problems with image plugin HOT 2
- Deleting a markdown block in the very first line HOT 1
- redraft renderer HOT 1
- Newline doesn't trigger expansion HOT 1
- Undo markdown
- Only expand inline styles (bold, italic, whitespace, etc.) when surround by space characters
- Bullet Shortcut does not erase placeholder
- Incompatibility with createLinkPlugin HOT 1
- How to init with pre content? HOT 2
- Link within existing text removes rest of line.
- keyBindingFn not triggering on tab key press
- Documentation missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draft-js-markdown-shortcuts-plugin.