Merge pull request #24373 from YousefED/patch-1

BackHandlerStatic returns NativeEventSubscription
This commit is contained in:
Mine Starks
2018-03-20 16:28:14 -07:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -6550,7 +6550,7 @@ export interface BackAndroidStatic {
*/
export interface BackHandlerStatic {
exitApp(): void;
addEventListener(eventName: BackPressEventName, handler: () => void): void;
addEventListener(eventName: BackPressEventName, handler: () => void): NativeEventSubscription;
removeEventListener(eventName: BackPressEventName, handler: () => void): void;
}
+3
View File
@@ -17,6 +17,7 @@ import {
AppState,
AppStateIOS,
BackAndroid,
BackHandler,
Button,
DataSourceAssetCallback,
DeviceEventEmitterStatic,
@@ -73,6 +74,8 @@ function testDimensions() {
Dimensions.removeEventListener('change', dimensionsListener);
}
BackHandler.addEventListener("hardwareBackPress", () => {}).remove();
BackAndroid.addEventListener("hardwareBackPress", () => {});
interface LocalStyles {