CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(web): fix navigator.onLine hydration mismatch (React error #418) #4054

Merged⚡ AI-generatedXSccantynz wants to mergeclaude/code-audit-vapron-migration-6jya3kmainopened Jun 16, 20260/3 tasks
ccantynzcommented Jun 16, 2026

Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/AlecRae.com/pull/77


$(cat <<'EOF'

Summary

  • OfflineComposeBanner and OfflineBadge were initializing isOnline as true (assuming online), then immediately setting it to navigator.onLine in a useEffect. If the client is offline, the server and client rendered different output, causing React hydration error #418.
  • Fix: initialize as null (unknown) and only show the offline UI when isOnline === false. Both server and client render nothing on first pass, eliminating the mismatch.

Test plan

  • Open mail.alecrae.com — no hydration errors in console
  • Go offline (DevTools → Network → Offline) — offline banner appears
  • Come back online — banner disappears

https://claude.ai/code/session_017mhAkS4qhMjcvVnyFi61xp EOF )


Generated by Claude Code

ccantynzcommented Jun 16, 2026

Originally written by @vercel[bot] on GitHub.


Deployment failed with the following error:

There is no GitHub account connected to this Vercel account.
ccantynzcommented Jun 16, 2026

Originally written by @vercel[bot] on GitHub.


The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
alec-rae-com-admin Error Error Jun 16, 2026 12:19am

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts