1.0.4 • Published 12 months ago

react-native-custom-toast-view v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Getting Started

Installation

npm i react-native-custom-toast-view --save

Usage

  1. Import package
import {ToastProvider} from 'react-native-custom-toast-view';
  1. Import the Provide and wrap the application component (in App.js)
const Root = () => (
  <ToastProvider>
    <App />
  </ToastProvider>
);
  1. Now, you can use the package like this (on any action)
import {useToastProvider} from 'react-native-custom-toast-view';   // import package
const {showToast} = useToastProvider();                            // use provider
showToast('Toast notification message', 'success')                 // use method direction
  1. The showToast() function accepts two arguments: the first is the message, and the second is the type (“success” or “error”).