-
Notifications
You must be signed in to change notification settings - Fork 689
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
Why is date-fns a peer dependency? #356
Comments
I'm curious if date-fns would be easier to remove unused date-fns functions if references were included as import addDays from 'date-fns/addDays' instead of import { addDays } from 'date-fns' |
Hey all, thank you for raising it and the fix. (And sorry for the delay, we are discussing how to improve the project maintenance) |
This has been release as 1.1.4 |
For example, we can: import AdapterDateFns from 'react-date-range/AdapterDateFns';
// import AdapterDayjs from 'react-date-range/AdapterDayjs';
return (
<DateRangePicker adapter={AdapterDateFns} />
) |
Subject of the issue
What's the exact reasoning behind having date-fns as a peer dependency? This really forces users to have this in their project, while they may not use any/may use another date library.
Also, what's the reasoning behind the choice for
date-fns
? Was this chosen arbitrarily, or is there a specific reason?When you compare
date-fns
to other libraries (e.g.dayjs
), you see that there's a huge difference in size.https://bundlephobia.com/result?p=date-fns@2.11.0
https://bundlephobia.com/result?p=dayjs@1.8.22
The text was updated successfully, but these errors were encountered: