mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
29 lines
721 B
TypeScript
29 lines
721 B
TypeScript
import * as React from 'react';
|
|
import { View, Button } from 'react-native';
|
|
import Toast, { Style } from 'react-native-toast-native';
|
|
|
|
class Test extends React.Component<any> {
|
|
showToast() {
|
|
const style: Style = {
|
|
color: 'white',
|
|
backgroundColor: '#5CB85C',
|
|
fontSize: 16,
|
|
height: 140,
|
|
borderRadius: 15,
|
|
fontWeight: 'bold',
|
|
yOffset: 40
|
|
};
|
|
|
|
Toast.show("I'm a toast!", Toast.SHORT, Toast.BOTTOM, style);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<View>
|
|
<Button
|
|
onPress={() => this.showToast()}
|
|
title="Show Toast" />
|
|
</View>);
|
|
}
|
|
}
|