Explorar o código

:fire: useEffect(() => setCurrPath

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
e2805b6d2c
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  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,