react-native-small-toast
v1.0.4
Published
React Native Toast component for both Android and iOS
Downloads
5
Readme
react-native-small-toast
Getting started
$ npm install react-native-small-toast --save
Usage
// First add the components to your root file App.js
import Toast from 'react-native-small-toast';
const App = () => {
return (
<>
<Toast ref={(ref) => Toast.setRef(ref)} />
// <YourComponents/> here
</>
);
}
export default App;
// Now import it anywhere in your app and use it
import { Text, TouchableOpacity } from 'react-native';
import Toast from 'react-native-small-toast';
export default ExampleToast () => {
const onClickChange = () => {
Toast.show({
text: "React Native Toast component for both Androi and iOS",
bgColor: '#000000',
color: '#FFFFFF',
})
}
return (
<TouchableOpacity onPress={onClickChange}>
<Text>Show Toast</Text>
</TouchableOpacity>
)
};