jpuri / react-draft-wysiwyg

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

TypeError: _block.getKey is not a function #1005

Open kumarabhirup opened 4 years ago

kumarabhirup commented 4 years ago

Reproduce the error

const DraftEditor = dynamic( async () => import("react-draft-wysiwyg").then(result => result.Editor), { ssr: false } )

export default function Editor({ ...props }) { return ( <>

</>

) }


- There you go! You get error `TypeError: _block.getKey is not a function`.

I use Next.js Dynamic Imports because of `window is undefined` error that we get on Next.js by using this library.

react-draft-wysiwyg version: `v1.14.5`

---

Did anyone get it working on Next.js? If yes, please let me know how.
s-kris commented 3 years ago

+1

reverting to immutable@3.7.6 fixes this. (source: draftjs-repo)