mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-17 21:10:48 +00:00
The hook returned a fresh object literal every render. The 26 methods inside were already useCallback([])-stable, but the wrapping object was not — so every consumer's effect with `terminalBackend` in deps (e.g. cwd polling, lifecycle wiring, write-to-session) re-ran on every parent render even though nothing semantic had changed, and ESLint flagged the one site that depended on a property access (`terminalBackend.onHostKeyVerification`) because it could not prove that path safe. Wrap the return in useMemo with all stable callbacks listed as deps so the object is computed once and cached for the hook's lifetime. Switch the host-key-verification effect's dep to the now-stable `terminalBackend`, clearing the warning at the root rather than patching it locally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>