withModal
withModal
is a HOC (Higher Order Component) which passes the modal
prop into a wrapped component. The function receives a component and outputs another one with the new prop. It's useful when you don't have access to the modal
prop into the component, or don't want to pass it in case of a deeply nested child.
API reference
Using withModal
will give you access to:
this.props.modal
currentModal
: name of the current displayed modal if there's oneopenModal
: open a specific modalcloseModal
: close a modalcloseModals
: close every instance of a given modalcloseAllModals
: close all opened modals
as seen in Modal prop.
Last updated