Draft-js — Saving data to the server
Julian Krispel
91

I have to disagree. If you do that you’re getting married (so to speak) with draft-js. You don’t know if draft is going to be your editor forever and if you do that you need a custom parser to make visible the content after you save it. If you don’t do that you need to use draft-js with readOnly mode and is not really performant.
In our case we parse each block and we generate markdown for text only blocks and the other blocks (images, links, videos, etc) they have their own structure. So, you end up with an array of objects that contains a type and data inside, like urls or markdown bodies to render that data after.

Like what you read? Give Gabriel Miranda a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.