Skip to content

Commit

Permalink
fix(TabsItem): use hasReactNode for status (#6125)
Browse files Browse the repository at this point in the history
* fix(TabsItem): use hasReactNode for status

* test(TabsItem): extend e2e config with status={0}
  • Loading branch information
inomdzhon authored Nov 20, 2023
1 parent aea2148 commit 3ecc3d9
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/vkui/src/components/Tabs/Tabs.e2e-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const TabsPlayground = (props: ComponentPlaygroundProps) => {
>
<TabsItem>Лента</TabsItem>
</Unscrollable>,
<Unscrollable key="tabs" status={23} />,
<Unscrollable key="tabs" status={0} />,
<Unscrollable key="tabs" status={23}>
<TabsItem>Лента</TabsItem>
</Unscrollable>,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/vkui/src/components/TabsItem/TabsItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { classNames } from '@vkontakte/vkjs';
import { classNames, hasReactNode } from '@vkontakte/vkjs';
import { useAdaptivity } from '../../hooks/useAdaptivity';
import { useExternRef } from '../../hooks/useExternRef';
import { usePrevious } from '../../hooks/usePrevious';
Expand Down Expand Up @@ -75,7 +75,7 @@ export const TabsItem = ({

const isTabFlow = role === 'tab';

if (status) {
if (hasReactNode(status)) {
statusComponent =
typeof status === 'number' ? (
<Subhead
Expand Down

0 comments on commit 3ecc3d9

Please sign in to comment.