useModal
Same as withModal
, useModal
gives you access to the modal
prop outside of a modal component. You'll use it if you want to take benefits or React's new hotness: hooks!
API reference
Using useModal
will give you access to an object containing:
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.
Note: Hooks require React 16.8.0+ which means you'll need to be on React Native 0.59.0+ for useModal
.
Last updated