react-native-global-modal-2
Version:
🌍 Global modal and callable from anywhere on the app for React Native
22 lines • 612 B
JavaScript
let modalRef = null;
const ModalController = {
setModalRef: (ref) => {
modalRef = ref;
},
show: (data) => {
if (!modalRef?.current) {
console.warn("Modal reference not set. Make sure GlobalModal is mounted.");
return;
}
modalRef.current.show(data);
},
hide: () => {
if (!modalRef?.current) {
console.warn("Modal reference not set. Make sure GlobalModal is mounted.");
return;
}
modalRef.current.hide();
},
};
export default ModalController;
//# sourceMappingURL=ModalController.js.map