Skip to content

Best way of rendering content of editor? #2455

Discussion options

You must be logged in to vote

There's really no definitive answer. It's whatever is best for your specific use case.

The Lexical readOnly mode on the editor is the easiest way to show serialized HTML or JSON editor state.

If client-side performance more of a concern though, you can build a separate "read-only" Lexical Editor which strips out any unnecessary plugins which are used in editing (e.g. OnChangePlugin).

For your specific use case, if you're display HTML which is saved in an admin panel elsewhere, you could just remove Lexical altogether on the client app and just render the saved HTML, though you would need to re-apply any custom styles.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@mhm13dev
Comment options

@potofpie
Comment options

@elbotho
Comment options

Answer selected by thegreatercurve
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants