Commit d71e398d authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #1503 from blockscout/tabs-fix

tabs re-render fix
parents 596ad55c b03c95c2
......@@ -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';
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment