react-code-dataset / recharts /src /context /legendPayloadContext.tsx
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
457 Bytes
import { LegendPayload } from '../component/DefaultLegendContent';
import { useAppSelector } from '../state/hooks';
import { selectLegendPayload } from '../state/selectors/legendSelectors';
/**
* Use this hook in Legend, or anywhere else where you want to read the current Legend items.
* @return all Legend items ready to be rendered
*/
export function useLegendPayload(): ReadonlyArray<LegendPayload> {
return useAppSelector(selectLegendPayload);
}