useRootClose
API
import useRootClose from 'react-overlays/useRootClose'useRootClose(ref: Ref<HTMLElement> | HTMLElement, onRootClose: function, options?: object) => voidThe
useRootClosehook registers your callback on the document when rendered. Powers the<Overlay/>component. This is used achieve modal style behavior where your callback is triggered when the user tries to interact with the rest of the document or hits theesckey.Parameters
refRef<HTMLElement> | HTMLElementThe element boundary
onRootClosefunctionoptions?objectdisabled?booleanclickTrigger?stringThe DOM event name (click, mousedown, etc) to attach listeners on