Skip to content

fix(login): render dev-login form client-only to avoid hydration mismatch#6

Open
RisingOrange wants to merge 1 commit intodevfrom
fix/dev-login-hydration
Open

fix(login): render dev-login form client-only to avoid hydration mismatch#6
RisingOrange wants to merge 1 commit intodevfrom
fix/dev-login-hydration

Conversation

@RisingOrange
Copy link
Copy Markdown
Collaborator

Summary

Password-manager extensions (Bitwarden, 1Password, LastPass, Dashlane) inject autofill icons and fill buttons into the dev-login form's <input> fields after SSR but before React hydration. React flags this as a hydration mismatch on every page load of /login in development.

suppressHydrationWarning only covers attribute mismatches on a single element — it doesn't catch a new injected child node — so attributes-level suppression wasn't enough.

Gate the form behind a useEffect-mounted flag so it renders client-only. The form is dev-only (isDev gated in page.tsx), so SSR was never useful here.

Test plan

  • Reload /login with a password-manager extension installed → no hydration warning in browser console.
  • Dev-login form still works after hydration (preset buttons, custom email form, workspace selector).
  • Production behavior unchanged — the form doesn't render in prod (isDev && ...).

…atch

Password manager extensions inject autofill icons / fill buttons into
the input fields after SSR but before React hydration, causing a
recoverable hydration mismatch. suppressHydrationWarning only covers
attribute mismatches on a single element, not new injected children.
Gate the form behind a useEffect-mounted flag so it renders client-only,
sidestepping hydration entirely. The form is dev-only, so SSR was never
useful here.
@RisingOrange RisingOrange changed the base branch from main to dev May 4, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant