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 7f9adaf commit 1025e31
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,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 1025e31

Please sign in to comment.