Browse Source

:fire: useEffect(() => setCurrPath

visuddhinanda 2 years ago
parent
commit
e2805b6d2c
1 changed files with 1 additions and 4 deletions
  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,