Readonly
nameThe name of the icon. By convention, the icon name will be namespaced as so:
"pkg-name:icon-name"
Optional
renderCustomize how a DOM node is rendered. If .renderer is set on a given instance of VirtualElement, this function will be called every time that VirtualElement is rendered.
The actual DOM node created for a VirtualElement during rendering.
On render, host is created and its attrs are set/updated via the standard routines in updateContent. host is then handed off to this function.
The render function is free to modify host. The only restriction is is that render should not modify any attributes set by external routines (ie updateContent), as this may cause thrashing when the virtual element is next rendered.
Optional
options: { Will be populated with the .attrs and .children fields set on the VirtualElement being rendered.
Optional
attrs?: ElementAttrsOptional
children?: readonly VirtualNode[]A string containing the raw contents of an svg file.
Optional
unrenderOptional cleanup function for custom renderers. If the .renderer field of a VirtualELement is set, and if .renderer.unrender is defined, when the element is changed or removed its corresponding DOM element will be passed to this function immediately before it is removed from the DOM.
unrender is not required for for simple renderers, such as those
implemented using document.createElement()
. However, for certain
rendering techniques explicit cleanup is required in order to avoid
resource leaks.
For example, if render calls ReactDOM.render(..., host)
, then
there has to also be a corresponding implementation of unrender that
calls ReactDOM.unmountComponentAtNode(host)
in order to prevent
a memory leak.
the DOM element to be removed.
Optional
options: { Will be populated with the .attrs and .children fields set on the VirtualElement being unrendered.
Optional
attrs?: ElementAttrsOptional
children?: readonly VirtualNode[]
Interface defining the parameters to be passed to the LabIcon constructor