react-native-small-toast

1.0.4 • Public • Published

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>
    )
};

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i react-native-small-toast

    Weekly Downloads

    3

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    24.4 kB

    Total Files

    15

    Last publish

    Collaborators

    • subhodip