@mui/x-charts
Version:
The community edition of MUI X Charts components.
16 lines (15 loc) • 695 B
JavaScript
'use client';
import { useStore } from "../internals/store/useStore.mjs";
import { selectorChartsHighlightStateCallback } from "../internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.mjs";
/**
* A hook to get a callback that returns the highlight state of an item.
*
* If you're interested by a single item, consider using `useItemHighlightState`.
*
* @returns {(item: HighlightItemIdentifierWithType | null) => HighlightState} callback to get the highlight state of an item.
*/
export function useItemHighlightStateGetter() {
const store = useStore();
const getHighlightState = store.use(selectorChartsHighlightStateCallback);
return getHighlightState;
}