Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

83
Views
Poor performance with a few hundred blocked dates in react-dates

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?

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

In the meantime, I came up with a solution. https://github.com/airbnb/react-dates/issues/2171

about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!