fix: resolve ESLint errors for React compiler rules

- Chat.tsx: replace mutable variable in render IIFE with useMemo+reduce
  to satisfy react-hooks/immutability rule
- ConnectionBanner.tsx: move setState calls into a useCallback to avoid
  synchronous setState in effect body (react-hooks/set-state-in-effect)
- useGateway.ts: suppress set-state-in-effect for legitimate mount init
This commit is contained in:
Nicolas Varrot
2026-02-12 01:42:40 +00:00
parent 375bd102d4
commit 29482e377a
4 changed files with 44 additions and 19 deletions

View File

@@ -307,6 +307,8 @@ export function useGateway() {
initRef.current = true;
const stored = getStoredCredentials();
if (stored) {
// Init on mount — setupClient sets state as part of establishing the connection
// eslint-disable-next-line react-hooks/set-state-in-effect
setupClient(stored.url, stored.token);
} else {
setAuthenticated(false);