Skip to content

[Bug]: Nested <button> elements cause hydration error in dashboard/profile pages #423

Description

@prasangeet

Short summary

Rendering the profile/dashboard pages triggers a React hydration error because a element is rendered inside another . This violates HTML semantics and causes hydration warnings/errors in Next.js.

Steps to reproduce

  1. Navigate to Dashboard → Profile
  2. Locate the Logout button implementation
  3. LogoutButton wraps a Button component while also rendering a native
  • This creates nested
  • elements
  • React/Next.js throws a hydration error
  • Expected behavior

    The Profile page should render without hydration errors, and the Logout button should not render nested

    elements.

    Actual behavior

    React/Next.js reports:

    In HTML,

    cannot be a descendant of .
    This will cause a hydration error.

    The LogoutButton component renders a native

    that wraps a Button component, resulting in invalid HTML.

    Affected area

    Dashboard

    Environment

    Browser: Brave
    OS: EndeavourOS
    Environment: Local development
    Next.js: 15.5.18
    Database: MongoDB (local)

    Screenshots, logs, or recordings

    Image Image

    Confirmation

    • I searched existing issues before opening this report.
    • I included enough detail for reproduction.

    Metadata

    Metadata

    Assignees

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions