Closed Rosey closed 7 years ago
Hi Rosey! You're absolutely right! They changed the API for this in one of the earlier releases and I updated it in the project I was using this in, but completely forgot to change the readme. Thanks a lot! I'll have a proper look tomorrow 😊
The usage instructions on the readme were incorrect for both draftjsToMd and mdToDraftjs, this commit seeks to remedy that :)
For draftjsToMd - The function expects a
raw
object, not theblocks
array. For mdToDraftjs -convertFromRaw
on theraw
object returned frommdToDraftJs
is a contentState object, nocreateFromBlockArray
required.Hi @kadikraman hopefully this looks right to you 😊 I was super confused when I added your package and was getting js errors. Then I checked out the source and realized that the readme instructions weren't quite 100% accurate!
Thanks!