Class VirtualElementPass

DEPRECATED - use VirtualElement with a defined renderer param instead. This class is provided as a backwards compatibility shim

A "pass thru" virtual node whose children are managed by a render and an unrender callback. The intent of this flavor of virtual node is to make it easy to blend other kinds of virtualdom (eg React) into Phosphor's virtualdom.


User code will not typically create a VirtualElementPass node directly. Instead, the hpass() function will be used to create an element tree.

Hierarchy (view full)




  • DEPRECATED - use VirtualElement with a defined renderer param instead

    Construct a new virtual element pass thru node.


    • tag: string

      the tag of the parent element of this node. Once the parent element is rendered, it will be passed as an argument to renderer.render

    • attrs: ElementAttrs

      attributes that will assigned to the parent element

    • renderer: null | VirtualElement.IRenderer

      an object with render and unrender functions, each of which should take a single argument of type HTMLElement and return nothing. If null, the parent element will be rendered barren without any children.

    Returns VirtualElementPass


The attributes for the element.

children: readonly VirtualNode[]

The children for the element.

renderer: undefined | VirtualElement.IRenderer

An optional custom renderer for the element's children. If set, on render this element's DOM node and it's attrs will be created/updated as normal. At that point the DOM node is handed off to the renderer.

tag: string

The tag name for the element.

type: "element" = ...

The type of the node.

This value can be used as a type guard for discriminating the VirtualNode union type.