Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-native-small-toast

Subhodipdeti21MIT1.0.4

React Native Toast component for both Android and iOS

react-native

readme

react-native-small-toast

npm version npm downloads

Getting started

$ npm install react-native-small-toast --save

Usage

// First add the components to your root file App.js
import Toast from 'react-native-small-toast';

const App = () => {
    return (
      <>
        <Toast ref={(ref) => Toast.setRef(ref)} />
            // <YourComponents/> here
      </>
    );
}

export default App;

// Now import it anywhere in your app and use it

import { Text, TouchableOpacity } from 'react-native';
import Toast from 'react-native-small-toast';

export default ExampleToast () => {
    const onClickChange = () => {
        Toast.show({
            text: "React Native Toast component for both Androi and iOS",
            bgColor: '#000000',
            color: '#FFFFFF',
    })
    }
    return (
        <TouchableOpacity onPress={onClickChange}>
            <Text>Show Toast</Text>
        </TouchableOpacity>
    )
};