Last active
October 26, 2018 06:02
-
-
Save jimmyurl/8f05a1308fcdbef11fca119b56cebfa2 to your computer and use it in GitHub Desktop.
React created by jimmyurl - https://repl.it/@jimmyurl/CavernousSleepyOpensoundsystem
This file contains 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 from 'react'; | |
import { Button, View } from 'react-native'; | |
const pressCount = 0; | |
export default class App extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
pressCount: 0, | |
} | |
} | |
componentDidUpdate() { | |
console.log('Press Count: ', this.state.pressCount); | |
} | |
render() { | |
return ( | |
<View style={{position: 'relative', top: 100}}> | |
<Button | |
title="Press Me!" | |
onPress={() => this.setState({pressCount: this.state.pressCount + 1})} | |
/> | |
</View> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment