draft-js-markdown-shortcuts-plugin
draft-js-markdown-shortcuts-plugin copied to clipboard
Breaks on latest Draft-JS-Plugins release :( (getEditorState is not a function)
Alas, looks like this broke with the release of the latest two versions of draft-js-plugins. Since those fix some super important bugs for me, it would be great if one could restore compatibility somehow.
Here are the error messages I am getting:
"Uncaught TypeError: getEditorState is not a function
at Object.handleReturn (http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:273059:25) at http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:266875:79 at Array.some (native) at Object.handleReturn (http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:266874:22) at editOnKeyDown (http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:256789:68) at http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:253856:19 at Object.ReactErrorUtils.js.ReactErrorUtils.invokeGuardedCallback (http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:142347:16) at executeDispatch (http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:142128:21) at Object.executeDispatchesInOrder (http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:142148:7) at executeDispatchesAndRelease (http://localhost:3000/packages/modules.js?hash=5f2b7e0054b9f5cd9059df7057b90d09e1f819fa:141535:22)
(Extended information) handleReturn @ modules.js?hash=5f2b7e0…:273059 (anonymous) @ modules.js?hash=5f2b7e0…:266875 (anonymous) @ modules.js?hash=5f2b7e0…:266874 editOnKeyDown @ modules.js?hash=5f2b7e0…:256789 (anonymous) @ modules.js?hash=5f2b7e0…:253856 ReactErrorUtils.js.ReactErrorUtils.invokeGuardedCallback @ modules.js?hash=5f2b7e0…:142347 executeDispatch @ modules.js?hash=5f2b7e0…:142128 executeDispatchesInOrder @ modules.js?hash=5f2b7e0…:142148 executeDispatchesAndRelease @ modules.js?hash=5f2b7e0…:141535 executeDispatchesAndReleaseTopLevel @ modules.js?hash=5f2b7e0…:141546 forEachAccumulated @ modules.js?hash=5f2b7e0…:142454 processEventQueue @ modules.js?hash=5f2b7e0…:141749 runEventQueueInBatch @ modules.js?hash=5f2b7e0…:148791 handleTopLevel @ modules.js?hash=5f2b7e0…:148802 handleTopLevelImpl @ modules.js?hash=5f2b7e0…:153863 perform @ modules.js?hash=5f2b7e0…:144887 batchedUpdates @ modules.js?hash=5f2b7e0…:153776 batchedUpdates @ modules.js?hash=5f2b7e0…:143557 dispatchEvent @ modules.js?hash=5f2b7e0…:153938"
@Discordius
Please try this quick fix on index.js.
- handleReturn(ev, { getEditorState, setEditorState }) {
+ handleReturn(ev, editorState, { setEditorState }) {
- handleBeforeInput(character, { getEditorState, setEditorState }) {
+ handleBeforeInput(character, editorState, { setEditorState }) {
(the latest draft-js-plugins is in the release candidate stage yet, so I'd like to create PR if this repository has an v2.0.0 branch)
I ran into this as well. PR was merged (#26) but is probably not on NPM as of this comment.
Since 0.3.0 this should hopefully no longer be an issue. @ngs this can probably be closed out
I have the same problem here https://github.com/facebook/draft-js/issues/473#issuecomment-373791338