UNPKG

@atlaskit/dropdown-menu

Version:

A dropdown menu displays a list of actions or options to a user.

18 lines (17 loc) 582 B
type CheckboxStateArgs = { id: string; isSelected: boolean | undefined; defaultSelected: boolean | undefined; }; type SetStateCallback = (value: boolean | undefined) => boolean; type CheckboxStateValue = [ boolean, (newValue: SetStateCallback) => void ]; /** * Custom hook to handle checkbox state for dropdown menu. * It works in tandem with the selection store context when the * component is uncontrolled. */ declare const useCheckboxState: ({ isSelected, id, defaultSelected, }: CheckboxStateArgs) => CheckboxStateValue; export default useCheckboxState;