itizawa 5 ani în urmă
părinte
comite
ed928ce9d7
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  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 { navTabMapping } = props;
   const [activeTab, setActiveTab] = useState('');
   // [TODO: set default active tab by gw4079]
   const [sliderWidth, setSliderWidth] = useState(null);
@@ -40,12 +41,12 @@ const CustomNavigation = (props) => {
       tempML += width;
       return { width, marginLeft };
     });
-    const { width, marginLeft } = styles[props.navTabMapping[activeTab].index];
+    const { width, marginLeft } = styles[navTabMapping[activeTab].index];
 
     setSliderWidth(width);
     setSliderMarginLeft(marginLeft);
 
-  }, [activeTab, props]);
+  }, [activeTab, navTabMapping]);
 
 
   return (