mergeElements()function
mergeElements(a: Elements<T>, b: Elements<T>): Elements<T>
mergeElements(a: Elements, b: Elements): Elements
| Param | Type | |
|---|---|---|
a | Elements<T> | The first elements. required |
b | Elements<T> | The second elements. required |
a | Elements | Collection of elements (compatible with React.ReactNode). required |
b | Elements | 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"]