Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Notes

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

Hierarchy

Index

Type aliases

Constructors

Properties

Type aliases

Static IRenderer

IRenderer: IRenderer

A type describing a custom element renderer DEPRECATED - use VirtualElement.IRenderer instead

A type describing a custom element renderer

Constructors

constructor

  • DEPRECATED - use VirtualElement with a defined renderer param instead

    Construct a new virtual element pass thru node.

    Parameters

    • 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: IRenderer | null

      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

Properties

attrs

The attributes for the element.

children

children: ReadonlyArray<VirtualNode>

The children for the element.

renderer

renderer: IRenderer | undefined

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

tag: string

The tag name for the element.

type

type: "element" = "element"

The type of the node.

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

Generated using TypeDoc