Skip to content

Commit

Permalink
Merge pull request blockscout#1503 from blockscout/tabs-fix
Browse files Browse the repository at this point in the history
tabs re-render fix
  • Loading branch information
isstuev authored Jan 16, 2024
2 parents 596ad55 + b03c95c commit d71e398
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/shared/Tabs/TabsWithScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import React, { useEffect, useRef, useState } from 'react';

import type { TabItem } from './types';

import isBrowser from 'lib/isBrowser';

import AdaptiveTabsList from './AdaptiveTabsList';
import { menuButton } from './utils';

Expand Down Expand Up @@ -39,7 +41,7 @@ const TabsWithScroll = ({
...themeProps
}: Props) => {
const [ activeTabIndex, setActiveTabIndex ] = useState<number>(defaultTabIndex || 0);
const [ screenWidth, setScreenWidth ] = React.useState(0);
const [ screenWidth, setScreenWidth ] = React.useState(isBrowser() ? window.innerWidth : 0);

const tabsRef = useRef<HTMLDivElement>(null);

Expand Down

0 comments on commit d71e398

Please sign in to comment.