Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks on latest Draft-JS-Plugins release :( (getEditorState is not a function) #23

Open
Discordius opened this issue May 24, 2017 · 4 comments

Comments

@Discordius
Copy link

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"

@esplo
Copy link

esplo commented May 28, 2017

@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)

@iansinnott
Copy link
Contributor

I ran into this as well. PR was merged (#26) but is probably not on NPM as of this comment.

@iansinnott
Copy link
Contributor

Since 0.3.0 this should hopefully no longer be an issue. @ngs this can probably be closed out

@francisrod01
Copy link

I have the same problem here facebookarchive/draft-js#473 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants