From 0f752f402f05ef5ad66210bdfca972a60c61ac8c Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Wed, 10 Jan 2024 18:37:39 +0530 Subject: [PATCH] refactor(web): addressing-sonar-check-issue --- web/src/context/NewDisputeContext.tsx | 29 +++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/web/src/context/NewDisputeContext.tsx b/web/src/context/NewDisputeContext.tsx index 87db67673..9d69bbeb9 100644 --- a/web/src/context/NewDisputeContext.tsx +++ b/web/src/context/NewDisputeContext.tsx @@ -90,22 +90,21 @@ export const NewDisputeProvider: React.FC<{ children: React.ReactNode }> = ({ ch setDisputeData(initialDisputeData); }; - return ( - - {children} - + const contextValues = useMemo( + () => ({ + disputeData, + setDisputeData, + disputeTemplate, + resetDisputeData, + isSubmittingCase, + setIsSubmittingCase, + isPolicyUploading, + setIsPolicyUploading, + }), + [disputeData, disputeTemplate, resetDisputeData, isSubmittingCase, isPolicyUploading] ); + + return {children}; }; const constructDisputeTemplate = (disputeData: IDisputeData) => {