()
| 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 |