react-modal-hook-manager
Version:
manage multi modal in react
16 lines (15 loc) • 670 B
TypeScript
/// <reference types="react" />
import { IModal } from './Interfaces';
export default function useModal(name?: string): {
getCurrentModal: () => IModal | null;
createModal: (name: string, component: JSX.Element, open?: boolean, meta?: any) => void;
toggleModal: (name?: string) => void;
openModal: (name?: string) => void;
closeModal: (name?: string, destroy?: boolean) => void;
closeAllModals: (names?: string[], destroy?: boolean) => void;
destroyModal: (name?: string) => void;
destroyAllModals: () => void;
isOpenModal: (name?: string) => boolean;
hasModal: (name?: string) => boolean;
getMeta: (name?: string) => any;
};