Skip to content

Commit

Permalink
Merge pull request #55 from MateuszWolkowicz/patch-1
Browse files Browse the repository at this point in the history
Preventing automatic call button onPress
  • Loading branch information
AurelGit authored Jul 5, 2019
2 parents 68e31f0 + dfff86b commit 505dc08
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions App/Containers/Example/ExampleScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const instructions = Platform.select({

class ExampleScreen extends React.Component {
componentDidMount() {
this.props.fetchUser()
this._fetchUser()
}

render() {
Expand Down Expand Up @@ -49,12 +49,16 @@ class ExampleScreen extends React.Component {
</Text>
</View>
)}
<Button onPress={this.props.fetchUser} title="Refresh" />
<Button onPress={() => this._fetchUser()} title="Refresh" />
</View>
)}
</View>
)
}

_fetchUser() {
this.props.fetchUser()
}
}

ExampleScreen.propTypes = {
Expand Down

0 comments on commit 505dc08

Please sign in to comment.