As the title says, the behavior of react-dates is very bad with a large number (~500) of blocked dates.
Code of whole application is here: https://github.com/milanpanin/react-dates/blob/master/src/App.js Also, app is live here: https://react-dates-test.netlify.app/ and here you can see how slow the application actually works 😕
// [disableNext3, disableBetween, disableNext6Between] - represent arrays with all together about 500 dates
const isBlocked = (day) => ([disableNext3, disableBetween, disableNext6Between].flat()).some(date => day.isSame(date, 'day'));
return (
<div className="App">
<DateRangePicker
startDateId="startDate"
endDateId="endDate"
startDate={startDate}
endDate={endDate}
onDatesChange={({ startDate, endDate }) => { setStartDate( startDate ), setEndDate( endDate )}}
focusedInput={focusedInput}
onFocusChange={(focusedInput) => { setSocusedInput( focusedInput )}}
isDayBlocked={isBlocked}
/>
...
I also tried to implement a spinner on each render, but without success. Is there any solution to my problem?
In the meantime, I came up with a solution. https://github.com/airbnb/react-dates/issues/2171