react native toastify code example

Example 1: react toastify

import React from 'react';

import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

function App(){
  const notify = () => toast("Wow so easy!");

  return (
    <div>
    <button onClick={notify}>Notify!</button>
<ToastContainer />
    </div>
);
}

Example 2: toast in react native

import {ToastAndroid} from 'react-native' ;

.... 

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

....

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

Example 4: react toastify

yarn add react-toastify