ModalComponentProp
Interface of the modal
prop exposed by the library specifically to modal components.
Note: ModalComponentProp
reuses the same types as ModalProp
and only adds 4 more on top of them. Starting with v3.5.0
, ModalProps
is a simplified way of usingModalComponentProp
.
API reference
addListener
addListener
Function that allows you to hook a listener to the modal component you're in. Right now, only 2 listener types are supported: 'onAnimate'
and 'onClose'
.
Example:
./modals/AlertModal.tsx
getParam
getParam
Function that looks inside params
and returns you the value of the key corresponding to paramName
. Returns the provided defaultValue
if nothing was found.
Example:
./modals/ErrorModal.js
removeAllListeners
removeAllListeners
Removes all the listeners connected to the modal component you're in.
Example:
./modals/AlertModal.tsx
params
params
Optional params you provided when opening the modal you're in.
Example:
./modals/ErrorModal.js
Last updated