Ver Fonte

:fire: useEffect 导致死循环的依赖 data

visuddhinanda há 3 anos atrás
pai
commit
36825ce1ee
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      dashboard/src/components/comment/CommentListCard.tsx

+ 1 - 1
dashboard/src/components/comment/CommentListCard.tsx

@@ -38,7 +38,7 @@ const Widget = ({
       return newItem;
     });
     setData(newData);
-  }, [changedAnswerCount, data]);
+  }, [changedAnswerCount]);
 
   useEffect(() => {
     let url: string = "";