You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we're using maxValue as a prop to useDateTimeRangePicker which is set to now(getLocalTimeZone()) (to prevent a user from setting and end time beyond the current moment). It's continuously causing re-renders in any component that calls it.
It'd obviously defeat the point if we memoized the current time. I thought we could call now() within the DateRangePicker itself at change time but it seems like the props are just forwarded to useDateRangePickerState. We can investigate further, maybe there's react-aria feature that'll handle this for us.
Don't think this is actually the reason, since now() will just get called when the component re-renders. Something else is afoot.
Activity
[-]`useDateTimeRangePicker` continuously re-renders[/-][+]`useDateTimeRangePicker` causing continuous re-renders[/+]benjaminleonard commentedon Jul 8, 2025
david-crespo commentedon Jul 8, 2025
Great illustration. I will look at this.
benjaminleonard commentedon Jul 8, 2025
If it helps, I think it is resolved removing
useDebounceinuseDateTimeRangePicker. Could be a good place to start.