react-native-crostini
0.1.1 • Public • Published react-native-crostini
Simple opinionless Toast with toppings.
Description
This package is designed to be an ultra light-weight themable universal opinionless hooks-based react-native toast provider.
Example
Wrap the provider around the app (or whever you want toasts to appear)
import {ToastProvider} from 'react-native-crostini';
export function AppContainer() {
return (
<ToastProvider>
<App />
</ToastProvider>
);
}
Then import the hook and create toasts
import React, {useEffect} from 'react';
import {Text, View} from 'react-native';
import {useToast} from 'react-native-crostini';
export function MyComponent() {
const {showToast} = useToast();
useEffect(() => {
showToast('MyComponent mounted!');
}, [showToast]);
return (
<View>
<Text>It works!</Text>
</View>
);
}
Versions
Version | Downloads (Last 7 Days) | Tag |
---|
0.1.1 | 1 | latest |
Version History
Version | Downloads (Last 7 Days) | Published |
---|
0.1.1 | 1 | |
0.1.0 | 0 | |
Package Sidebar
Install
npm i react-native-crostini
Weekly Downloads