MCPcopy
hub / github.com/reactjs/react-tabs / deepForEach

Function deepForEach

src/helpers/childrenDeepMap.js:34–51  ·  view source on GitHub ↗
(children, callback)

Source from the content-addressed store, hash-verified

32}
33
34export 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}

Callers 2

getTabsCountFunction · 0.90
childrenPropTypeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…