MCPcopy Create free account
hub / github.com/adobe/react-spectrum / childNodes

Function childNodes

packages/react-stately/src/table/TableBody.ts:40–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 hasChildNodes: true,
39 props,
40 *childNodes() {
41 if (typeof children === 'function') {
42 if (!items) {
43 throw new Error('props.children was a function but props.items is missing');
44 }
45
46 for (let item of items) {
47 yield {
48 type: 'item',
49 value: item,
50 renderer: children
51 };
52 }
53 } else {
54 let items: PartialNode<T>[] = [];
55 React.Children.forEach(children, item => {
56 items.push({
57 type: 'item',
58 element: item
59 });
60 });
61
62 yield* items;
63 }
64 }
65 };
66};
67

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected