hypeserver / react-date-range

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

Infinite scroll does not work with React Strict Mode #653

Open delasource opened 1 month ago

delasource commented 1 month ago

Subject of the issue

Within the tag <React.StrictMode> a DateRangePicker component does not work. It can not track the scrollposition to show the full calender. Only "months-prop +1" months are visible. CleanShot_2024-09-14_003438

[BUG] Bug Reproduce Steps

Create a vite project and add the infinite-scroll-example code under the StrictMode-Element.

[BUG] Expected behaviour

Look like on demo page.

Environment

Package Version: 2.0.1 (also tested 1.4.0, and also tested @iroomitapp 's fork) React version: ^18 Node version: v22.7.0 (but using bun 1.1.12 as package manager) Browser: Brave

fnnzzz commented 1 month ago

The same problem (1.4.0)

Also, I encountered the next problem with enabled strict mode if months={1.3}:

image

React: v18.3.1 Node: v22.8.0 Package Version: 1.4.0 Browser: Firefox