Skip to content

Commit

Permalink
correct-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Nov 14, 2024
1 parent a070ed6 commit e487754
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/x-charts/src/internals/useStore.ts
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit e487754

Please sign in to comment.