Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Nov 13, 2024
1 parent 9af0972 commit 930746f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 2 additions & 6 deletions packages/x-charts/src/ChartsTooltip/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
export * from './ChartsTooltip';
export * from './ChartsTooltipContainer';
export {
ChartsTooltipClasses,
ChartsTooltipClassKey,
getChartsTooltipUtilityClass,
chartsTooltipClasses,
} from './chartsTooltipClasses';
export type { ChartsTooltipClasses, ChartsTooltipClassKey } from './chartsTooltipClasses';
export { getChartsTooltipUtilityClass, chartsTooltipClasses } from './chartsTooltipClasses';

export * from './ChartsAxisTooltipContent';
export * from './ChartsItemTooltipContent';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/hooks/useAxisEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const useAxisEvents = (disableAxisListener: boolean) => {
const drawingArea = useDrawingArea();
const { xAxis, yAxis, xAxisIds, yAxisIds } = useCartesianContext();

const store = useStore();
const store = useStore(disableAxisListener);

const usedXAxis = xAxisIds[0];
const usedYAxis = yAxisIds[0];
Expand Down
9 changes: 8 additions & 1 deletion packages/x-charts/src/internals/useStore.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import * as React from 'react';
import { ChartsContext } from '../context/InteractionProvider';

export function useStore() {
export function useStore(skip?: boolean) {
const charts = React.useContext(ChartsContext);

if (skip === undefined) {
// 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;
}
if (!charts) {
throw new Error(
[
Expand Down

0 comments on commit 930746f

Please sign in to comment.