From 874a636e113e4e6006ee3df41b5e1dcbe3e29519 Mon Sep 17 00:00:00 2001 From: Jacques Ikot Date: Thu, 15 Aug 2024 10:05:22 +0100 Subject: [PATCH] add useMemo to isCellCompletelyValid --- .../TableWidgetV2/component/cellComponents/DateCell.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/client/src/widgets/TableWidgetV2/component/cellComponents/DateCell.tsx b/app/client/src/widgets/TableWidgetV2/component/cellComponents/DateCell.tsx index 9ff551556c1c..16f1bf8811df 100644 --- a/app/client/src/widgets/TableWidgetV2/component/cellComponents/DateCell.tsx +++ b/app/client/src/widgets/TableWidgetV2/component/cellComponents/DateCell.tsx @@ -196,7 +196,10 @@ export const DateCell = (props: DateComponentProps) => { const [isValid, setIsValid] = useState(true); const [showRequiredError, setShowRequiredError] = useState(false); const contentRef = useRef(null); - const isCellCompletelyValid = isEditableCellValid && isValid; + const isCellCompletelyValid = useMemo( + () => isEditableCellValid && isValid, + [isEditableCellValid, isValid], + ); const valueInISOFormat = useMemo(() => { if (typeof value !== "string") return "";