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.34.1.pre.alpha.powerfontsexternal3403 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.0.0 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.1.pre.alpha.PLAY14633399 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PLAY14143373 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PLAY14143372 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.1 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3368 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PLAY14143358 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0.pre.alpha.PLAY14143357 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.34.0 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.1.pre.alpha.PLAY14143340 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.1.pre.alpha.PLAY14143336 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-13.33.1 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx