Last active
February 25, 2020 17:03
-
-
Save r3dm1ke/1e9b3c5ac9c043cc81a4d272c481c4fe 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, {useState} from 'react'; | |
| import { StyleSheet, Text, View, Button } from 'react-native'; | |
| export default function App() { | |
| const [counter, setCounter] = useState(0); | |
| return ( | |
| <View style={styles.container}> | |
| <Text | |
| style={styles.label} | |
| testID={'counter'} | |
| > | |
| You clicked the button {counter} times. | |
| </Text> | |
| <Button | |
| testID={'button'} | |
| onPress={() => setCounter(counter + 1)} | |
| title={'Press me'} | |
| /> | |
| </View> | |
| ); | |
| } | |
| const styles = StyleSheet.create({ | |
| label: { | |
| marginBottom: 16 | |
| }, | |
| container: { | |
| flex: 1, | |
| backgroundColor: '#fff', | |
| alignItems: 'center', | |
| justifyContent: 'center', | |
| }, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment