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.33.0.pre.alpha.PLAY14143318 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.0.pre.alpha.PLAY14143312 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.0.pre.alpha.PBNTR405dropdownformfixesrails3311 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.0.pre.alpha.PLAY1454formpillicons3309 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.0.pre.alpha.PLAY14143306 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.0.pre.alpha.PLAY14143305 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.0 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PBNTR405dropdownformfixesrails3301 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143297 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143288 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143272 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143271 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY1138iconkitaddcolorprop3268 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143267 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3266 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143264 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143260 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143255 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.PLAY14143251 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3239 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx