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 #5223

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.

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

martijnrusschen commented 1 week ago

looks like the linter is failing, can you review and fix?

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 (8b3f157) to head (066da4f). Report is 7 commits behind head on main.

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

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