Toast Message in Multiple Lines
Note: You must be using React Native 0.60.0 or higher to use the most recent version of @rabiloo/react-native-toast
.
yarn add @rabiloo/react-native-toast
OR FROM GIT
yarn add https://github.com/rabiloo/react-native-toast.git
- Step 1: Import Toast into your App.js file
import React from 'react';
import {Toast} from '@rabiloo/react-native-toast';
export default function App() {
return (
<View>
<YourChild />
<Toast />
</View>
);
}
- Step 2: use ToastService to push a message
import {ToastService} from '@rabiloo/react-native-toast';
ToastService.set({message: 'Hello world', position: 'top'});
- position: String
Position of the toast: 'top', 'bottom'. Default is bottom.
- message: String
Style for toast wrapper component
Style for a toast item
Style for Text
The duration for which a toast is displayed on screen
Number of toast is displayed on the screen
This simplifies the development and the testing of the project.
If you require new features or bug fixes for older versions you can fork this project.
MIT