Skip to content
Discussion options

You must be logged in to vote

This is done with a decoratornode.
Assuming you are using react.
You could create a new class that extends DecoratorNode<JSX.Element>
then it should have a decorate method (among others) that return a element.
This element is not managed by lexical, and you can make changes to it and its descendants (if it has any).
Also a common pattern is creating an other react component which is returned by decorate. this allows for complex behaviour, and as a central place to manage commands for that node.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dataman-fan
Comment options

You must be logged in to vote
0 replies
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
3 participants