Sha256: 07dbfecf6289e39d753f165d96ba106a39d9a6df2af4e145cba6072126fd2cc7

Contents?: true

Size: 329 Bytes

Versions: 536

Compression:

Stored size: 329 Bytes

Contents

import {useState} from 'react';


const useDropdown = (initial= true) => {
    
const [isDropDownClosed, setIsDropDownClosed] = useState(initial);

const toggleDropdown = () => setIsDropDownClosed((prev) => !prev);

return [
    isDropDownClosed,
    setIsDropDownClosed as any,
    toggleDropdown
]
}

export default useDropdown

Version data entries

536 entries across 536 versions & 1 rubygems

Version Path
playbook_ui-13.29.0.pre.alpha.testingcollapsibleissue3052 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.29.0 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.28.0.pre.alpha.PBNTR297gradientoverlay3029 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.28.0.pre.alpha.pbntr312tableheaderflexremoval3019 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.28.0.pre.alpha.dialogturbostreameventlistener3017 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1338alpha3001 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2987 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2986 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.28.0.pre.alpha.PLAY1343fixTooltiprunwayissue2984 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.27.0 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.26.0.pre.alpha.PBNTR291Dropdownrailsv22840 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12820 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.26.0.pre.alpha.jasoncypretpatch12816 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.25.0.pre.alpha.PBNTR291Dropdownrailsv22812 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.26.0 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.25.0.pre.alpha.PBNTR272Dropdownkitv42769 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx