RootNode

class RootNode(val container: Element, val child: Base) extends ParentNode[Element]

RootNode will mount itself (and the child) if the container node is attached to the DOM at RootNode initialization time.

RootNode will mount itself (and the child) if the container node is attached to the DOM at RootNode initialization time.

Note: RootNode does not receive any outside notifications about the container being attached or detached from the DOM.

If you are trying to create a Laminar RootNode inside a React.js component, make sure to call:

  • mount() when componentDidMount is due, and
  • unmount() when componentWillUnmount is due.

Other libraries' integration follows the same principle.

trait ParentNode[Element]
trait ReactiveNode[Element]
class Object
trait Matchable
class Any

Value members

Concrete methods

def mount(): Boolean
Returns

Whether child was successfully mounted

def unmount(): Boolean
Returns

Whether child was successfully unmounted

Deprecated and Inherited methods

@deprecated("ParentNode.maybeChildren will be removed in a future version of Laminar.", "0.8") @inline
def maybeChildren: Option[List[Base]]
Deprecated
Inherited from
ParentNode

Concrete fields

val child: Base
val container: Element
override val ref: Element

When we create a Root, we don't want to create a new HTML Element, we want to use a reference to an existing element, the container.

When we create a Root, we don't want to create a new HTML Element, we want to use a reference to an existing element, the container.