(children, callback)
| 32 | } |
| 33 | |
| 34 | export function deepForEach(children, callback) { |
| 35 | return Children.forEach(children, (child) => { |
| 36 | // null happens when conditionally rendering TabPanel/Tab |
| 37 | // see https://github.com/reactjs/react-tabs/issues/37 |
| 38 | if (child === null) return; |
| 39 | |
| 40 | if (isTab(child) || isTabPanel(child)) { |
| 41 | callback(child); |
| 42 | } else if ( |
| 43 | child.props && |
| 44 | child.props.children && |
| 45 | typeof child.props.children === 'object' |
| 46 | ) { |
| 47 | if (isTabList(child)) callback(child); |
| 48 | deepForEach(child.props.children, callback); |
| 49 | } |
| 50 | }); |
| 51 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…