Skip to content

Commit 906e486

Browse files
inomdzhonactions-user
authored andcommitted
fix(TabsItem): use hasReactNode for status (#6125)
* fix(TabsItem): use hasReactNode for status * test(TabsItem): extend e2e config with status={0}
1 parent 929c30c commit 906e486

12 files changed

+23
-23
lines changed

packages/vkui/src/components/Tabs/Tabs.e2e-playground.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const TabsPlayground = (props: ComponentPlaygroundProps) => {
111111
>
112112
<TabsItem>Лента</TabsItem>
113113
</Unscrollable>,
114-
<Unscrollable key="tabs" status={23} />,
114+
<Unscrollable key="tabs" status={0} />,
115115
<Unscrollable key="tabs" status={23}>
116116
<TabsItem>Лента</TabsItem>
117117
</Unscrollable>,
Loading
Loading
Loading
Loading
Loading

packages/vkui/src/components/TabsItem/TabsItem.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { classNames } from '@vkontakte/vkjs';
2+
import { classNames, hasReactNode } from '@vkontakte/vkjs';
33
import { useAdaptivity } from '../../hooks/useAdaptivity';
44
import { useExternRef } from '../../hooks/useExternRef';
55
import { usePrevious } from '../../hooks/usePrevious';
@@ -75,7 +75,7 @@ export const TabsItem = ({
7575

7676
const isTabFlow = role === 'tab';
7777

78-
if (status) {
78+
if (hasReactNode(status)) {
7979
statusComponent =
8080
typeof status === 'number' ? (
8181
<Subhead

0 commit comments

Comments
 (0)