Package Exports
- react-native-reanimated-toast
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-reanimated-toast) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Reanimated Toast
🌟 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.