Created
August 26, 2020 14:55
-
-
Save mrcthms/bdbbc1c9735490616e613b7b1b748595 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dropdown } from '@invisionapp/helios' | |
import { useState } from 'react' | |
function Component(props) { | |
const [isOpen, setIsOpen] = useState(false) | |
const handleToggleVisibility = () => { | |
setIsOpen(!isOpen) | |
} | |
const handleChangeVisibility = (state) => { | |
analytics.track('foo bar', state.OPEN) | |
} | |
return ( | |
<Dropdown | |
{...props} | |
open={isOpen} | |
onRequestToggleVisibility={handleToggleVisibility} | |
onChangeVisibility={handleChangeVisibility} | |
/> | |
) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment