[fix] AppState event handler registration

Fix #151
This commit is contained in:
Nicolas Gallagher
2016-06-21 14:57:53 -07:00
parent eca2f69593
commit af40f98f23
6 changed files with 67 additions and 16 deletions
+1 -2
View File
@@ -37,7 +37,6 @@ class Example extends React.Component {
constructor(props) {
super(props)
this.state = { currentAppState: AppState.currentState }
this._handleAppStateChange = this._handleAppStateChange.bind(this)
}
componentDidMount() {
@@ -48,7 +47,7 @@ class Example extends React.Component {
AppState.removeEventListener('change', this._handleAppStateChange);
}
_handleAppStateChange(currentAppState) {
_handleAppStateChange = (currentAppState) => {
this.setState({ currentAppState });
}