12345678910111213141516171819202122232425262728 |
- import Toast from 'react-native-root-toast';
- export const ShowToast = message => {
- let toast = Toast.show(message, {
- duration: Toast.durations.LONG,
- position: 0,
- shadow: true,
- animation: true,
- hideOnPress: true,
- delay: 0,
- onShow: () => {
- // calls on toast\`s appear animation start
- },
- onShown: () => {
- // calls on toast\`s appear animation end.
- },
- onHide: () => {
- // calls on toast\`s hide animation start.
- },
- onHidden: () => {
- // calls on toast\`s hide animation end.
- },
- });
- setTimeout(function() {
- Toast.hide(toast);
- }, 1500);
- };
|