RootNode

com.raquo.laminar.nodes.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.

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.

Attributes

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

Members list

Value members

Concrete methods

def mount(): Boolean

Attributes

Returns

Whether child was successfully mounted

def unmount(): Boolean

Attributes

Returns

Whether child was successfully unmounted

Concrete fields

val child: Base
val container: Element
final 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.

Attributes