Class: LineBreakNode
lexical.LineBreakNode
Hierarchy
↳
LineBreakNode
Constructors
constructor
• new LineBreakNode(key?
)
Parameters
Name | Type |
---|---|
key? | string |
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:32
Methods
createDOM
▸ createDOM(): HTMLElement
Called during the reconciliation process to determine which nodes to insert into the DOM for this Lexical Node.
This method must return exactly one HTMLElement. Nested elements are not supported.
Do not attempt to update the Lexical EditorState during this phase of the update lifecyle.
Returns
HTMLElement
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:40
exportJSON
▸ exportJSON(): SerializedLexicalNode
Controls how the this node is serialized to JSON. This is important for copy and paste between Lexical editors sharing the same namespace. It's also important if you're serializing to JSON for persistent storage somewhere. See Serialization & Deserialization.
Returns
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:87
getTextContent
▸ getTextContent(): "\n"
Returns the text content of the node. Override this for custom nodes that should have a representation in plain text format (for copy + paste, for example)
Returns
"\n"
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:36
updateDOM
▸ updateDOM(): false
Called when a node changes and should update the DOM in whatever way is necessary to make it align with any changes that might have happened during the update.
Returning "true" here will cause lexical to unmount and recreate the DOM node (by calling createDOM). You would need to do this if the element tag changes, for instance.
Returns
false
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:44
clone
▸ Static
clone(node
): LineBreakNode
Clones this node, creating a new node with a different key and adding it to the EditorState (but not attaching it anywhere!). All nodes must implement this method.
Parameters
Name | Type |
---|---|
node | LineBreakNode |
Returns
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:28
getType
▸ Static
getType(): string
Returns the string type of this node. Every node must implement this and it MUST BE UNIQUE amongst nodes registered on the editor.
Returns
string
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:24
importDOM
▸ Static
importDOM(): null
| DOMConversionMap
<HTMLElement
>
Returns
null
| DOMConversionMap
<HTMLElement
>
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:48
importJSON
▸ Static
importJSON(serializedLineBreakNode
): LineBreakNode
Controls how the this node is deserialized from JSON. This is usually boilerplate, but provides an abstraction between the node implementation and serialized interface that can be important if you ever make breaking changes to a node schema (by adding or removing properties). See Serialization & Deserialization.
Parameters
Name | Type |
---|---|
serializedLineBreakNode | SerializedLexicalNode |
Returns
Overrides
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:81