Selaa lähdekoodia

:fire: useEffect(() => setCurrPath

visuddhinanda 2 vuotta sitten
vanhempi
sitoutus
e2805b6d2c
1 muutettua tiedostoa jossa 1 lisäystä ja 4 poistoa
  1. 1 4
      dashboard/src/components/article/ArticleView.tsx

+ 1 - 4
dashboard/src/components/article/ArticleView.tsx

@@ -51,9 +51,6 @@ const ArticleViewWidget = ({
   remains,
   onPathChange,
 }: IWidgetArticleData) => {
-  const [currPath, setCurrPath] = useState(path);
-
-  useEffect(() => setCurrPath(path), [path]);
   console.log("ArticleViewWidget render");
 
   let currChannelList = <></>;
@@ -91,7 +88,7 @@ const ArticleViewWidget = ({
 
       <Space direction="vertical">
         <TocPath
-          data={currPath}
+          data={path}
           channel={channels}
           onChange={(
             node: ITocPathNode,