How to close dock by clicking on non-dock area
andyafter opened this issue · 1 comments
andyafter commented
Gidgidonihah commented
Simple answer:
Pass a function to
onVisibleChange
Pseudo code answer:
export default class MyDock extends React.Component {
constructor(props) {
super(props)
this.state = {
isVisible: true,
}
}
toggleVisibility = () => {
this.setState({ isVisible: !this.state.isVisible })
}
render() {
return (
<Dock
isVisible={this.state.isVisible}
onVisibleChange={this.toggleVisibility}
>
Contents of the dock
</Dock>
)
}
}