A typographical logo of Contenido.

Empty raw content state

A raw content state that you can use to initialize an empty state in SSR.

Usage #

When you're implementing your editor with SSR (like Next.js) there could be some issues with the very first content state that you use in your editor (The one that you create with EditorState.createEmpty()). This commonly because of the key difference of the content state on the server and the client side. To fix this issue and have a clean state in SSR you may need to pass the very first content state with the same key on both server and client side. The following constant is an empty and raw content state that you can easily store and pass it to the editor as the first state

Example #

An example of emptyRawContentState usage:



Made with ❤ for a better experience

MIT © 2023 - This site does not track you.