From e905a9783cb55a13367f589eef0128530bf6fa59 Mon Sep 17 00:00:00 2001 From: I00068 Date: Wed, 2 Jul 2025 15:22:26 +0200 Subject: [PATCH] fix compile error on reportRef["current"] --- React-TS/Embed for your organization/UserOwnsData/src/App.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React-TS/Embed for your organization/UserOwnsData/src/App.tsx b/React-TS/Embed for your organization/UserOwnsData/src/App.tsx index cf6aacc4..2100df54 100644 --- a/React-TS/Embed for your organization/UserOwnsData/src/App.tsx +++ b/React-TS/Embed for your organization/UserOwnsData/src/App.tsx @@ -15,7 +15,7 @@ const powerbi = new service.Service(factories.hpmFactory, factories.wpmpFactory, let accessToken = ""; let embedUrl = ""; let reportContainer: HTMLElement; -let reportRef: React.Ref; +let reportRef: React.RefObject; let loading: JSX.Element; // eslint-disable-next-line @typescript-eslint/no-empty-interface @@ -106,7 +106,7 @@ class App extends React.Component { // React function componentDidMount(): void { if (reportRef !== null) { - reportContainer = reportRef["current"]; + reportContainer = reportRef.current!; } // User input - null check