useModal
provides automatic binding for component Modal, which can reduce the amount of repetitive code and improve the development experience.
Using this hooks behaves the same as if you had added React.useState
manually.
This hooks also supports use on Select component.
Use hooks to control Modal
.
type useModal = (initialVisible: boolean) => {
visible: boolean
setVisible: Dispatch<SetStateAction<boolean>>
setVisible: Dispatch<SetStateAction<boolean>>
currentRef: MutableRefObject<boolean>
bindings: {
visible: boolean
onClose: () => void
}
}
Previous
useMediaQuery
Next
useScale