npm @rehookify/datepicker 3.0.0
v3.0.0 controlled date-picker

latest releases: 6.6.8, 6.6.7, 6.6.6...
2 years ago

v3.0.0 Are you ready for an upgrade? Introducing version 3.0.0 of our date picker! 🎉

This release brings a game-changing feature: the date picker is now a controlled component. This is a widely used pattern for interacting with date pickers, allowing for more control and flexibility in your applications.
With this update, every time a date is selected, it will be passed to the onDatesChange function. However, please note that this update also brings some breaking changes.

🚫 Breaking changes

  • 👮 The date picker is now controlled, so you'll need to pass the selectedDates and onDatesChange to the configuration.
  • 🙅‍♂️ Additionally, the setDay and setRangeEnd actions have been removed, so you can now manipulate selectedDates outside of the date picker.

Migrating from version 2 to version 3 is simple:

  1. Remove selectedDates from the "dates" configuration
  2. Make date picker controlled
const [selectedDates, onDatesChange] = useState<Date[]>([]);
const { data } = useDatePicker({
  selectedDates,
  onDatesChange,
})
  1. Remove all logic with setDay and setRangeEnd actions.

But don't worry, after these changes, you'll be good to go and enjoy the power of a controlled date picker!🎉

Don't miss a new datepicker release

NewReleases is sending notifications on new releases.