closeModal: (modalName?: M, callback?: () => void) => void
This function closes the currently displayed modal by default. Incidentally, you can also provide a modalName if you want to close a different modal than the latest opened.
closeModals: (modalName: M, callback?: () => void) => boolean
This function closes all the instances of a given modal. You can use it whenever you have the same modal opened several times, to close all of them at once.
This function opens a modal based on the provided modalName. It will look at the stack passed to <ModalProvider> and add the corresponding component to the current stack of open modals. Alternatively, you can also provide some params that will be accessible to that component.