Skip to content

useDateTimeRangePicker causing continuous re-renders #2848

@benjaminleonard

Description

@benjaminleonard

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions