react native toast code example

Example 1: toast in react native

import {ToastAndroid} from 'react-native' ;

.... 

ToastAndroid.showWithGravity(
	"All Your Base Are Belong To Us",
    ToastAndroid.SHORT,
    ToastAndroid.CENTER
);

....

Example 2: react toast

import { ToastProvider } from 'react-toast-notifications';
import { Snack } from '../snackbar';

const App = () => (
  <ToastProvider
    autoDismiss
    autoDismissTimeout={6000}
    components={{ Toast: Snack }}
    placement="bottom-center"
	appearance: 'success',
    autoDismiss: true,
  >
    ...
  </ToastProvider>
);

Example 3: react native toast

npm install react-native-simple-toast --save
react-native link react-native-simple-toast // only RN < 0.60
cd ios && pod install

Tags:

Misc Example