Replies: 1 comment
-
By looking at LexicalEditorState - seems like there is no way/interface/hook to attach a data object to it. Any other ideas? |
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
-
Hi there,
I'm using lexical to host many different types of "DecoratorNode", these nodes share one CONTEXT so that they can reference each other in the editor. Now, I'm working on
exportJSON
part - my question is:Most of the properties are stored in the context object, and each node only maintains an ID property, so to support serialization, I only export "ID" in each node, but I need a point to export all the context info so that we can look up state in
importJson
to restore its (React) state.How should I export the context object? Is there an interface to support this customization?
FYI. My editor is structured like this -
ColumnsCommandPlugin will create many different nodes, all nodes will access the context object through
React.useContext
.Appreciate your input!
Beta Was this translation helpful? Give feedback.
All reactions