This library provides the ability to define alerts which can be used all across an application. Instead of having a separate function for all these alerts, we can define them when the application starts and easily use them wherever we need them.
npm install @qeepsake/react-native-custom-alerts
or
yarn add @qeepsake/react-native-custom-alerts
You need to register you alerts when the application starts.
import {CustomAlert} from 'react-native-custom-alerts';
CustomAlert.setup('my-custom-alert', 'Title', 'Message', buttons, options);
CustomAlert.setup('my-second-alert', 'Title', 'Message', buttons, options);
Now, you can place the alert you want to show elsewhere in your application.
import {CustomAlert} from 'react-native-custom-alerts';
CustomAlert.alert('my-second-alert');
static setup(name, title, message?, buttons?, options?)
static alert(name)
This project is licensed under the MIT License