@scrumble-nl/react-quick-modal
Version:
A quick and easy wrapper around react-bootstrap modal, you can add or remove a modal from anywhere in your application with a few simple steps.
15 lines (14 loc) • 457 B
TypeScript
import { ComponentType } from 'react';
export { default as Modal } from './modal';
export { ModalProvider } from './modal-provider';
export { withModal, useModal } from './modal-consumer';
export type ModalPropsWith = {
modal: ModalHook;
};
export type ModalHook = {
showModal<P extends ModalProps>(component: ComponentType<P>, props?: Omit<P, keyof ModalProps>): void;
hideModal(): void;
};
export type ModalProps = {
hideModal(): void;
};