Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct type inheritance in CalendarContainer props #5365

Merged

Conversation

iskkiri
Copy link
Contributor

@iskkiri iskkiri commented Jan 30, 2025

Description

Linked issue: #5364

Problem
The CalendarContainerProps interface currently extends React.PropsWithChildren<HTMLDivElement>, which causes TypeScript errors when using CalendarContainer in custom implementations. This incorrect type inheritance prevents proper type checking for HTML attributes.

Changes

  • Updated CalendarContainerProps to extend React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>> instead of HTMLDivElement
  • This change allows the component to properly type-check all valid HTML attributes that can be passed to a div element
  • Fixes TypeScript errors that occur when using CalendarContainer in custom container implementations

Screenshots

N/A

To reviewers

This is a type-only change that fixes TypeScript errors while maintaining the same runtime behavior. The change makes the type definition more accurate by properly inheriting HTML attribute types.

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

Update CalendarContainerProps to extend HTMLAttributes<HTMLDivElement> instead of HTMLDivElement. This fixes the type definition to properly include all valid HTML attributes that can be passed to the div element, improving type safety and developer experience.
Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ This pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!

What to expect from this code review:
  • Comments posted to any areas of potential concern or improvement.
  • Detailed feedback or actions needed to resolve issues that are found.
  • Turnaround times vary, but we aim to be swift.

@iskkiri you can click here to see the review status or cancel the code review job.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PullRequest Breakdown

Reviewable lines of change

+ 2
- 2

100% TSX

Type of change

Fix - These changes are likely to be fixing a bug or issue.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.87%. Comparing base (3acee46) to head (1e5571d).
Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5365   +/-   ##
=======================================
  Coverage   96.87%   96.87%           
=======================================
  Files          30       30           
  Lines        3358     3358           
  Branches     1428     1427    -1     
=======================================
  Hits         3253     3253           
  Misses        103      103           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no concerns with this pull request.

Image of Jacob Jacob


Reviewed with ❤️ by PullRequest

@martijnrusschen martijnrusschen merged commit f89ae4b into Hacker0x01:main Jan 31, 2025
6 checks passed
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.

2 participants