hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

date-fns wrong dependency in package.json #615

Open shemadolev opened 11 months ago

shemadolev commented 11 months ago

Subject of the issue

date-fns should be in dependencies, otherwise apps won't start.

[BUG] Bug Reproduce Steps

  1. Install react-date-range without installing date-fns.
  2. Starting the app fails with an errors like: \ Module not found: Error: Can't resolve 'date-fns/max' in '[...]\node_modules\react-date-range\dist\components\Calendar'

[BUG] Expected behaviour

As this package uses date-fns (in Calendar for example), it should be a dependency and not a peerDependency, which will make npm installing this package also install the needed date-fns package.

Environment

Package Version: 1.4.0 React version: 17.0.2 Node version: 16.16.0

shemadolev commented 11 months ago

Note - I'm locally resolving this issue by adding on my package.json the dependency of date-fns.