mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
fix new flow errors after D3561327
Reviewed By: bestander Differential Revision: D3561376 fbshipit-source-id: 226f0d1c6a771a987f9e04f114dc3ba1cca531b1
This commit is contained in:
committed by
Facebook Github Bot 1
parent
f5ba1693fe
commit
9bfa393a79
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
|
||||
class NavigationEventPool {
|
||||
_list: Array<any>;
|
||||
@@ -37,7 +37,7 @@ class NavigationEventPool {
|
||||
}
|
||||
|
||||
get(type: string, currentTarget: Object, data: any): NavigationEvent {
|
||||
var event;
|
||||
let event;
|
||||
if (this._list.length > 0) {
|
||||
event = this._list.pop();
|
||||
event.constructor.call(event, type, currentTarget, data);
|
||||
@@ -52,7 +52,7 @@ class NavigationEventPool {
|
||||
}
|
||||
}
|
||||
|
||||
var _navigationEventPool = new NavigationEventPool();
|
||||
const _navigationEventPool = new NavigationEventPool();
|
||||
|
||||
/**
|
||||
* The NavigationEvent interface represents any event of the navigation.
|
||||
@@ -87,7 +87,7 @@ class NavigationEvent {
|
||||
_defaultPrevented: boolean;
|
||||
_disposed: boolean;
|
||||
_propagationStopped: boolean;
|
||||
_type: ?string;
|
||||
_type: string;
|
||||
|
||||
target: ?Object;
|
||||
|
||||
@@ -111,22 +111,18 @@ class NavigationEvent {
|
||||
this._propagationStopped = false;
|
||||
}
|
||||
|
||||
/* $FlowFixMe - get/set properties not yet supported */
|
||||
get type(): string {
|
||||
return this._type;
|
||||
}
|
||||
|
||||
/* $FlowFixMe - get/set properties not yet supported */
|
||||
get currentTarget(): Object {
|
||||
get currentTarget(): ?Object {
|
||||
return this._currentTarget;
|
||||
}
|
||||
|
||||
/* $FlowFixMe - get/set properties not yet supported */
|
||||
get data(): any {
|
||||
return this._data;
|
||||
}
|
||||
|
||||
/* $FlowFixMe - get/set properties not yet supported */
|
||||
get defaultPrevented(): boolean {
|
||||
return this._defaultPrevented;
|
||||
}
|
||||
@@ -160,7 +156,7 @@ class NavigationEvent {
|
||||
// Clean up.
|
||||
this.target = null;
|
||||
this.eventPhase = NavigationEvent.NONE;
|
||||
this._type = null;
|
||||
this._type = '';
|
||||
this._currentTarget = null;
|
||||
this._data = null;
|
||||
this._defaultPrevented = false;
|
||||
|
||||
@@ -61,12 +61,10 @@ class RouteStack {
|
||||
this._index = index;
|
||||
}
|
||||
|
||||
/* $FlowFixMe - get/set properties not yet supported */
|
||||
get size(): number {
|
||||
return this._routeNodes.size;
|
||||
}
|
||||
|
||||
/* $FlowFixMe - get/set properties not yet supported */
|
||||
get index(): number {
|
||||
return this._index;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user