Skip to content

Commit

Permalink
refactor(app): 修复 chat组件中的 useEffect 依赖项
Browse files Browse the repository at this point in the history
- 在 chat 组件中的 useEffect钩子中添加了空依赖项数组
- 这样可以确保 fetchData 函数只在组件挂载时执行一次
  • Loading branch information
kiritoko1029 committed Nov 29, 2024
1 parent 00b42fc commit e59af78
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1664,8 +1664,7 @@ function _Chat() {
};
useEffect(() => {
fetchData();
});

}, []);
return (
<>
<div className={styles.chat} key={session.id}>
Expand Down

0 comments on commit e59af78

Please sign in to comment.