Hacker0x01 / react-datepicker

A simple and reusable datepicker component for React
https://reactdatepicker.com/
MIT License
8.12k stars 2.24k forks source link

fix(types): `PropsWithChildren` type argument issue #5236

Closed mertJF closed 1 week ago

mertJF commented 1 week ago

Problem The current CalendarProps type definition is incorrect, leading to type errors when using the component. This issue arises because React.PropsWithChildren is a generic type that requires a type argument to specify the component's props.

Same as: #5223

Changes This PR fixes the type definition by correctly combining React.PropsWithChildren with CalendarProps. This ensures proper type checking and prevents potential runtime errors.

Screenshots

error

Contribution checklist

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.89%. Comparing base (65bcb7e) to head (c7a151e). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5236 +/- ## ======================================= Coverage 96.89% 96.89% ======================================= Files 29 29 Lines 3381 3381 Branches 1414 1401 -13 ======================================= Hits 3276 3276 - Misses 103 105 +2 + Partials 2 0 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.