Skip to content

Fix unused imports and prevent hydration mismatch in BookingCard #205

Description

@mspandey

Description

The BookingCard component currently has a few minor issues that need to be addressed to ensure clean code and prevent runtime errors.

First, there are unused imports (MessageSquare from lucide-react and useCallback from react) that can trigger linting warnings. Second, the component formats the checkIn and checkOut dates using toLocaleDateString directly during the initial render. In a Next.js environment, this is a common cause of Hydration Mismatch errors, as the server's timezone/locale might differ from the user's browser, resulting in conflicting HTML.

Scope of Work

  • Clean up imports: Remove MessageSquare and useCallback from the top of the file.
  • Fix Hydration Risk: Introduce a mounted state using useState and useEffect to safely delay the locale-specific date formatting until after the component has mounted on the client (or supply a fallback string like "Loading..." for the initial server render).

pls assign it to me

Metadata

Metadata

Assignees

No one assigned

    Labels

    ELUSOCEduLinkUp Summer of Code 2026

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions