Best way of rendering content of editor? #2455
-
What is the best approach of just showing the content of lexical that was written in administration to be shown in the client zone without the ability to edit it?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
There's really no definitive answer. It's whatever is best for your specific use case. The Lexical 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. 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. |
Beta Was this translation helpful? Give feedback.
-
how to render json lexical from db to html on solidjs.
|
Beta Was this translation helpful? Give feedback.
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.