import React, { useState } from "react"; import { isSameDay } from "date-fns"; import { DayEventHandler, DayPicker } from "react-day-picker"; export function CustomMultiple() { const [value, setValue] = useState([]); const handleDayClick: DayEventHandler = ( day, modifiers ) => { const newValue = [...value]; if (modifiers.selected) { const index = value.findIndex((d) => isSameDay(day, d)); newValue.splice(index, 1); } else { newValue.push(day); } setValue(newValue); }; const handleResetClick = () => setValue([]); let footer = <>Please pick one or more days.; if (value.length > 0) footer = ( <> You selected {value.length} days.{" "} ); return ( ); }