From ddecc2029070cab9d4f9638b437ba751b76b41dc Mon Sep 17 00:00:00 2001 From: srmukher <120183316+srmukher@users.noreply.github.com> Date: Thu, 12 Dec 2024 04:29:45 +0000 Subject: [PATCH] Adding theme check for dark mode --- .../src/components/DeclarativeChart/DeclarativeChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/charts/react-charting/src/components/DeclarativeChart/DeclarativeChart.tsx b/packages/charts/react-charting/src/components/DeclarativeChart/DeclarativeChart.tsx index 7c27bfc94b911..ee2f9f254ff4a 100644 --- a/packages/charts/react-charting/src/components/DeclarativeChart/DeclarativeChart.tsx +++ b/packages/charts/react-charting/src/components/DeclarativeChart/DeclarativeChart.tsx @@ -29,7 +29,7 @@ import { useTheme } from '@fluentui/react'; export const UseIsDarkTheme = (): boolean => { const theme = useTheme(); - return theme.isInverted; + return theme?.isInverted ?? false; }; export interface Schema {