1.0.4 • Published 1 year ago

rn-toast-message v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

rn-toast-message

rn-toast-message is toast message for react native

Installation

rn-toast-message uses React Native Reanimated version 3.0.0. Be sure you installed React Native Reanimated version 3.0.0.

npm install rn-toast-message
or
yarn add rn-toast-message

Usage

app.tsx

import React from "react";
import YourApp from "./src/YourApp";
import { ToastMessageProvider } from "rn-toast-message";

const App = () => {
  return (
    <ToastMessageProvider>
      <YourApp />
    </ToastMessageProvider>
  );
};

export default App;
import { Pressable, StyleSheet, Text, View } from "react-native";
import React from "react";
import { useToast } from "rn-toast-message";

const YourApp = () => {
  const { showToast } = useToast();
  return (
    <View
      style={{
        flex: 1,
        alignItems: "center",
        justifyContent: "center",
      }}
    >
      <Pressable
        onPress={() => {
          showToast({
            message: "Hello From Toast Message",
            type: "success",
            duration: 3000,
            textStyle: {
              color: "white",
            },
          });
        }}
      >
        <Text>Show Toast</Text>
      </Pressable>
    </View>
  );
};

export default YourApp;

const styles = StyleSheet.create({});

License

MIT

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago