From e487754fea74234c0f66f9eeff0b030222eae273 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 14 Nov 2024 10:41:36 +0100 Subject: [PATCH] correct-fix --- packages/x-charts/src/internals/useStore.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/x-charts/src/internals/useStore.ts b/packages/x-charts/src/internals/useStore.ts index fe35081ef56c1..99778bb9f5993 100644 --- a/packages/x-charts/src/internals/useStore.ts +++ b/packages/x-charts/src/internals/useStore.ts @@ -1,15 +1,15 @@ import * as React from 'react'; import { ChartsContext } from '../context/InteractionProvider'; -export function useStore(skip?: boolean) { +export function useStore(skipError?: boolean) { const charts = React.useContext(ChartsContext); - if (skip === undefined) { + if (skipError) { // This line is only for `useAxisEvents` which is in the surface of the Gauge. // But the Gauge don't have store yet because it does not need the interaction provider. // Will be fixed when every thing move to the store since every component will have access to it. // @ts-ignore - return charts.store; + return charts?.store; } if (!charts) { throw new Error(