Skip to content

Commit

Permalink
Memoize initial form values.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisoelkers committed Sep 29, 2022
1 parent a560b5c commit f875c10
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const TimeRangeDropdown = ({
);

const _validateTimeRange = useCallback(({ nextTimeRange }) => dateTimeValidate(nextTimeRange, limitDuration, formatTime), [formatTime, limitDuration]);
const initialTimeRange = { nextTimeRange: onInitializingNextTimeRange(currentTimeRange) };
const initialTimeRange = useMemo(() => ({ nextTimeRange: onInitializingNextTimeRange(currentTimeRange) }), [currentTimeRange]);

return (
<StyledPopover id="timerange-type"
Expand Down

0 comments on commit f875c10

Please sign in to comment.