UNPKG

733 BJavaScriptView Raw
1/**
2 * @description A tag to enable returning sibling elements. This is useful for returning list items to render in a list or table cells to render in a table row.
3 * @example
4 * <Fragment>
5 * <li>A</li>
6 * <li>B</li>
7 * <li>C</li>
8 * </Fragment>
9 * Or functionally:
10 * Fragment(null, [
11 * h('li', {}, 'A'),
12 * h('li', {}, 'B'),
13 * h('li', {}, 'C')
14 * ])
15 * @param {null|Object} props When using Fragment as a function, props is the first argument. Provide either null or {} as the value for props.
16 * @param {any[]} children The siblings to return with the Fragment. This will be an array of sibling elements.
17 * @returns {object[]} An array of virtual nodes.
18 */
19export const Fragment = (props, children) => children