Created
December 18, 2019 10:58
-
-
Save tobob/8ed221c2f501074b581c217b5128165d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useContext} from 'react'; | |
import {View, Text, TouchableOpacity, StyleSheet} from 'react-native'; | |
import {ToastContext} from './ToastContext'; | |
const HomeScreen = () => { | |
const {show} = useContext(ToastContext); | |
return ( | |
<View style={styles.container}> | |
<TouchableOpacity onPress={() => show({message: 'Ama simple Toast!'})}> | |
<Text>Show Toast</Text> | |
</TouchableOpacity> | |
</View> | |
); | |
}; | |
export default HomeScreen; | |
const styles = StyleSheet.create({ | |
container: {flex: 1, alignItems: 'center', justifyContent: 'center'}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment