1.3.0-rc.6 ā€¢ Published 3 years ago

react-native-reanimated-toast v1.3.0-rc.6

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

runs with expo typescript License: MIT PRs Welcome

šŸŒŸ Features

  • High performance with Reanimated v2
  • Autocompletion thanks to TypeScript
  • Easily customizable
  • Runs with Expo

Installation

āš ļø You need to install react-native-reanimated v2 & react-native-gesture-handler and follow their installation instructions.

yarn add react-native-reanimated-toast

Wrap the whole app in ToastProvider. Usually you'd do this in your entry file, such as index.js or App.js:

import * as React from 'react';
import { ToastProvider } from "react-native-reanimated-toast";

export default function App() {
  return (
    <ToastProvider>
      {/* Rest of your app code */}
    <ToastProvider>
  );

Example Usage

Use the useToast hook in any of your function components'.

const ToastExample = () => {
  const { showToast } = useToast();

  return (
    <TouchableOpacity
      onPress={() => {
        showToast({
          title: "Announcement",
          message: "šŸ‘‹ Hello world from toast!",
        });
      }}
    >
      Show toast
    </TouchableOpacity>
  );
};

License

Licensed under the MIT license.


šŸ‘‰ View Example App