mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-07 13:05:18 +08:00
[AdsManager] Fix Navigation focus events for logging
This commit is contained in:
@@ -44,7 +44,8 @@ class NavigationContext {
|
||||
constructor() {
|
||||
this._eventEmitter = new NavigationEventEmitter(this);
|
||||
this._currentRoute = null;
|
||||
this.addListener('didfocus', this._onDidFocus, this);
|
||||
this.addListener('willfocus', this._onFocus, this);
|
||||
this.addListener('didfocus', this._onFocus, this);
|
||||
}
|
||||
|
||||
// TODO: @flow does not like this getter. Will add @flow check back once
|
||||
@@ -83,7 +84,7 @@ class NavigationContext {
|
||||
}
|
||||
}
|
||||
|
||||
_onDidFocus(event: NavigationEvent): void {
|
||||
_onFocus(event: NavigationEvent): void {
|
||||
invariant(
|
||||
event.data && event.data.hasOwnProperty('route'),
|
||||
'didfocus event should provide route'
|
||||
|
||||
Reference in New Issue
Block a user