Package Exports
- inferno-vnode-flags
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (inferno-vnode-flags) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
inferno-vnode-flags
Inferno VNode Flags is a small utility library for Inferno.
Usage of inferno-vnode-flags should be limited to assigning VNodeFlags and ChildFlags when using creating vNodes.
Install
npm install --save inferno-vnode-flagsContents
VNodeFlags:
VNodeFlags.HtmlElementVNodeFlags.ComponentUnknownVNodeFlags.ComponentClassVNodeFlags.ComponentFunctionVNodeFlags.TextVNodeFlags.SvgElementVNodeFlags.InputElementVNodeFlags.TextareaElementVNodeFlags.SelectElementVNodeFlags.VoidVNodeFlags.PortalVNodeFlags.ReCreate(JSX $ReCreate) always re-creates the vNodeVNodeFlags.ContentEditableVNodeFlags.FragmentVNodeFlags.InUseVnodeFlags.ForwardRefVNodeFlags.Normalized
VNodeFlags Masks:
VNodeFlags.ForwardRefComponentFunctional component wrapped in forward refVNodeFlags.FormElement- Is form elementVNodeFlags.Element- Is vNode elementVNodeFlags.Component- Is vNode ComponentVNodeFlags.DOMRef- Bit set when vNode holds DOM referenceVNodeFlags.InUseOrNormalized- VNode is used somewhere else or came from normalization processVNodeFlags.ClearInUseNormalized- Opposite mask of InUse or Normalized
ChildFlags
ChildFlags.UnknownChildrenneeds NormalizationChildFlags.HasInvalidChildrenis invalid (null, undefined, false, true)ChildFlags.HasVNodeChildren(JSX $HasVNodeChildren) is single vNode (Element/Component)ChildFlags.HasNonKeyedChildren(JSX $HasNonKeyedChildren) is Array of vNodes non keyed (no nesting, no holes)ChildFlags.HasKeyedChildren(JSX $HasKeyedChildren) is Array of vNodes keyed (no nesting, no holes)ChildFlags.HasTextChildren(JSX $HasTextChildren) vNode contains only text
ChildFlags Masks
ChildFlags.MultipleChildrenIs Array
You can easily combine multiple flags, by using bitwise operators. A common use case is an element that has keyed children: