Skip to content

Instantly share code, notes, and snippets.

@mrcthms
Created August 26, 2020 14:55
Show Gist options
  • Save mrcthms/bdbbc1c9735490616e613b7b1b748595 to your computer and use it in GitHub Desktop.
Save mrcthms/bdbbc1c9735490616e613b7b1b748595 to your computer and use it in GitHub Desktop.
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