Method Fragment
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Fragment(VNode?[], string?)
Fragment node. Returns multiple nodes without an enclosing wrapper element.
When key is supplied, the Fragment's children participate in the
parent's keyed sibling list as a single keyed unit: their identity is scoped by
key so siblings under a Fragment with a different key do not collide,
and per-child fiber state (Hooks, refs) is preserved across reorders of the keyed
Fragments.
public static FragmentNode Fragment(VNode?[] children, string? key = null)
Parameters
childrenVNode[]Child VNodes returned as a flat sibling list.
keystringOptional key used to disambiguate the Fragment from siblings at the same position. Must not contain a NUL (U+0000) character; NUL is reserved as the internal scope delimiter used by the reconciler to compose Fragment scope chains.
Returns
- FragmentNode
The created FragmentNode.
Exceptions
- ArgumentException
Thrown when
keycontains a NUL character.