UNPKG

react-tabs

Version:

An accessible and easy tab component for ReactJS

16 lines 443 B
import { deepForEach } from './childrenDeepMap'; import { isTab, isTabPanel } from './elementTypes'; export function getTabsCount(children) { var tabCount = 0; deepForEach(children, function (child) { if (isTab(child)) tabCount++; }); return tabCount; } export function getPanelsCount(children) { var panelCount = 0; deepForEach(children, function (child) { if (isTabPanel(child)) panelCount++; }); return panelCount; }