From f87a768305114281ae2f48a9f4a31760b89bd4a8 Mon Sep 17 00:00:00 2001 From: AntoineDoubovetzky Date: Thu, 24 Mar 2022 16:59:04 +0100 Subject: [PATCH] :bug: (AppState) fix removeEventListener adding another listener when type is blur or focus --- Libraries/AppState/AppState.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index 89459dd41045..4c091c00e8d7 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -154,7 +154,7 @@ class AppState { case 'focus': // $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type // $FlowIssue[incompatible-call] - emitter.addListener('appStateFocusChange', listener); + emitter.removeListener('appStateFocusChange', listener); return; } throw new Error('Trying to unsubscribe from unknown event: ' + type);