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

Function childNodes

packages/react-stately/src/collections/Section.ts:32–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 rendered: title,
31 'aria-label': props['aria-label'],
32 *childNodes() {
33 if (typeof children === 'function') {
34 if (!items) {
35 throw new Error('props.children was a function but props.items is missing');
36 }
37
38 for (let item of items) {
39 yield {
40 type: 'item',
41 value: item,
42 renderer: children
43 };
44 }
45 } else {
46 let items: PartialNode<T>[] = [];
47 React.Children.forEach(children, child => {
48 items.push({
49 type: 'item',
50 element: child
51 });
52 });
53
54 yield* items;
55 }
56 }
57 };
58};
59

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected