@redocly/theme 0.37.1 → 0.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ const hooks_1 = require("../../../core/hooks");
11
11
  function Tabs({ children, className }) {
12
12
  var _a, _b;
13
13
  const childrenArray = react_1.default.Children.toArray(children);
14
- const initialTab = (_b = (_a = children[0]) === null || _a === void 0 ? void 0 : _a.props.label) !== null && _b !== void 0 ? _b : '';
14
+ const initialTab = (_b = (_a = childrenArray[0]) === null || _a === void 0 ? void 0 : _a.props.label) !== null && _b !== void 0 ? _b : '';
15
15
  const { activeTab, setTabRef, onTabClick, handleKeyboard, getTabId } = (0, hooks_1.useTabs)({
16
16
  initialTab,
17
17
  totalTabs: childrenArray.length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.37.1",
3
+ "version": "0.37.2",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -10,7 +10,7 @@ type TabsProps = React.PropsWithChildren<{ children: Child[]; className?: string
10
10
  export function Tabs({ children, className }: TabsProps): JSX.Element {
11
11
  const childrenArray = React.Children.toArray(children) as React.ReactElement[];
12
12
 
13
- const initialTab = children[0]?.props.label ?? '';
13
+ const initialTab = childrenArray[0]?.props.label ?? '';
14
14
  const { activeTab, setTabRef, onTabClick, handleKeyboard, getTabId } = useTabs({
15
15
  initialTab,
16
16
  totalTabs: childrenArray.length,