useDisClosure
- handle common open, close, toggle and isOpen value
Features
- you can get by destructuring assignment
Types
const useDisClosure: (initialIsOpen?: boolean) => {
isOpen: boolean;
open: () => void;
close: () => void;
toggle: () => void;
};
Example
const App = () => {
const { isOpen, close } = useDisClosure(true);
};