UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

16 lines (15 loc) 565 B
'use client'; import { useStore } from "../internals/store/useStore.js"; import { selectorChartsItemIsFocused } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js"; /** * A hook to check if an item has the focus. * * If you need to process multiple points, use the `useIsItemFocusedGetter` hook instead. * * @param {FocusedItemIdentifier} item is the item to check * @returns {boolean} the focus state */ export function useIsItemFocused(item) { const store = useStore(); return store.use(selectorChartsItemIsFocused, item); }