浏览代码

:fire: useEffect(() => setCurrPath

visuddhinanda 2 年之前
父节点
当前提交
e2805b6d2c
共有 1 个文件被更改,包括 1 次插入4 次删除
  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,