From 10a41ba0646d101b9bb96619163246e38985c31e Mon Sep 17 00:00:00 2001 From: filip131311 Date: Fri, 20 Dec 2024 18:15:40 +0100 Subject: [PATCH] CR --- .../src/webview/providers/TelemetryProvider.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vscode-extension/src/webview/providers/TelemetryProvider.tsx b/packages/vscode-extension/src/webview/providers/TelemetryProvider.tsx index b2061b1f9..2f69bb5a5 100644 --- a/packages/vscode-extension/src/webview/providers/TelemetryProvider.tsx +++ b/packages/vscode-extension/src/webview/providers/TelemetryProvider.tsx @@ -1,4 +1,4 @@ -import { createContext, PropsWithChildren, useContext, useEffect, useState } from "react"; +import { createContext, PropsWithChildren, useContext, useEffect, useMemo, useState } from "react"; import { useUtils } from "./UtilsProvider"; type TelemetryContextProps = { telemetryEnabled: boolean }; @@ -18,9 +18,9 @@ export function TelemetryProvider({ children }: PropsWithChildren) { }; }, []); - return ( - {children} - ); + const contextValue = useMemo(() => ({ telemetryEnabled }), [telemetryEnabled]); + + return {children}; } export function useTelemetry() {