Replies: 2 comments
-
You should be able to use the same component as you used in the edit view, just by changing it to readOnly mode. You can find more details about the two modes here: https://lexical.dev/docs/concepts/read-only But in short, all you should need is to change editable to false on your config: <LexicalComposer initialConfig={{editable: false}}>
...
</LexicalComposer> |
Beta Was this translation helpful? Give feedback.
0 replies
-
Maybe it's useful for your usecase too (e.g. if it's for serverside rendering). I made a CLI tool for editorState JSON -> HTML rendering: https://github.com/vadimkantorov/lexical-cli-render |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I saved lexical content as JSON in my database. Now I want to display this content on a web page. I checked the following webpage: https://lexical.dev/docs/concepts/serialization, but couldn't find a straightforward answer. Let's say I retrieve the JSON version of some content that I saved using Lexical. How can I take this JSON and display it in the format I originally typed it? For example, if I have italicized, emboldened, or turned some text into a heading, how would I render these elements as HTML? I'm using React and Next.js.
Beta Was this translation helpful? Give feedback.
All reactions