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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user