Commit 3e0134e7 authored by tom's avatar tom

more improvements

parent 54e7744e
......@@ -57,6 +57,10 @@ export default function useAdaptiveTabs(tabs: Array<RoutedTab>) {
}, [ calculateCut, tabsRefs ]);
React.useEffect(() => {
if (tabsRefs.length === 0) {
return;
}
const resizeHandler = _debounce(() => {
setTabsCut(calculateCut());
}, 100);
......@@ -66,7 +70,7 @@ export default function useAdaptiveTabs(tabs: Array<RoutedTab>) {
return function cleanup() {
resizeObserver.unobserve(document.body);
};
}, [ calculateCut ]);
}, [ calculateCut, tabsRefs.length ]);
return React.useMemo(() => {
return {
......
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