-
|
I'm looking to create a custom
I can almost get there using Current code: export class MyCustomNode extends DecoratorNode<JSX.Element> {
...
createDOM(): HTMLElement {
const element = document.createElement('span');
element.textContent = 'Some text';
return element;
}
decorate(): JSX.Element {
return <MyCustomComponent />;
}
}This works great when serialized to HTML but when rendered inside the Lexical editor I get: <span>Some text<MyCustomComponent/></span>instead of just: <MyCustomComponent />Any recommendations would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Figured it out. I need to use |
Beta Was this translation helpful? Give feedback.
Figured it out. I need to use
exportDOM()instead.