Last active
February 7, 2019 12:30
-
-
Save dblazeski/fc119d640275f044bb1cd81af89b5a81 to your computer and use it in GitHub Desktop.
Register screen focus listener, onScreenFocus() called when the screen is focused initially
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
| class HomeScreen extends React.Component { | |
| componentDidMount() { | |
| // Listen for screen focus event | |
| this.props.navigation.addListener('didFocus', this.onScreenFocus) | |
| } | |
| // Called when our screen is focused | |
| onScreenFocus = () => { | |
| // Screen was focused, our on focus logic goes here | |
| this.reloadHomePage() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment