Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Fix [UI/UX] [Front End] Stupid complexity react warning (#270)
Browse files Browse the repository at this point in the history
- [+] fix(chat.tsx): add config.autoScrollMessage to useEffect dependencies to eliminate react warning
  • Loading branch information
H0llyW00dzZ authored Feb 10, 2024
1 parent eb4d85c commit 2e2454e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,14 @@ function _Chat() {
setHitBottom(isHitBottom);
let isAutoScrollEnabled: boolean = config.autoScrollMessage;
setAutoScroll(isAutoScrollEnabled);
}, [setHitBottom, setAutoScroll, isMobileScreen, msgRenderIndex, setMsgRenderIndex]); // Added setMsgRenderIndex
}, [
setHitBottom,
setAutoScroll,
isMobileScreen,
msgRenderIndex,
setMsgRenderIndex, // Added setMsgRenderIndex
config.autoScrollMessage // Include this dependency as indicated by the stupid complexity react warning
]);

// Use the custom hook to debounce the onChatBodyScroll function
useDebouncedEffect(() => {
Expand Down

0 comments on commit 2e2454e

Please sign in to comment.