Просмотр исходного кода

:fire: useEffect(() => setCurrPath

visuddhinanda 2 лет назад
Родитель
Сommit
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,