mergeElements()function

mergeElements(a: Elements<T>, b: Elements<T>): Elements<T>
mergeElements(a: Elements, b: Elements): Elements
ParamType
aElements<T>
The first elements. required
bElements<T>
The second elements. required
aElements
Collection of elements (compatible with React.ReactNode). required
bElements
Collection of elements (compatible with React.ReactNode). required
Return
Elements<T>
The combined Elements, or whichever side is set if the other is falsy.
Elements
Collection of elements (compatible with React.ReactNode).

Combine two Elements, preserving both if both are set.

  • If either side is falsy the other side is returned unchanged.

Examples

mergeElements("a", "b") // ["a", "b"]