itizawa 5 лет назад
Родитель
Сommit
ed928ce9d7
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/client/js/components/CustomNavigation.jsx

+ 3 - 2
src/client/js/components/CustomNavigation.jsx

@@ -6,6 +6,7 @@ import {
 
 
 
 
 const CustomNavigation = (props) => {
 const CustomNavigation = (props) => {
+  const { navTabMapping } = props;
   const [activeTab, setActiveTab] = useState('');
   const [activeTab, setActiveTab] = useState('');
   // [TODO: set default active tab by gw4079]
   // [TODO: set default active tab by gw4079]
   const [sliderWidth, setSliderWidth] = useState(null);
   const [sliderWidth, setSliderWidth] = useState(null);
@@ -40,12 +41,12 @@ const CustomNavigation = (props) => {
       tempML += width;
       tempML += width;
       return { width, marginLeft };
       return { width, marginLeft };
     });
     });
-    const { width, marginLeft } = styles[props.navTabMapping[activeTab].index];
+    const { width, marginLeft } = styles[navTabMapping[activeTab].index];
 
 
     setSliderWidth(width);
     setSliderWidth(width);
     setSliderMarginLeft(marginLeft);
     setSliderMarginLeft(marginLeft);
 
 
-  }, [activeTab, props]);
+  }, [activeTab, navTabMapping]);
 
 
 
 
   return (
   return (