diff --git a/native/lifecycle/lifecycle.js b/native/lifecycle/lifecycle.js index 0613a70f8..8dbd5fa44 100644 --- a/native/lifecycle/lifecycle.js +++ b/native/lifecycle/lifecycle.js @@ -1,31 +1,26 @@ // @flow import { Platform, AppState as NativeAppState } from 'react-native'; import { type LifecycleState } from 'lib/types/lifecycle-state-types'; import type { EventSubscription } from '../types/react-native'; import { getLifecycleEventEmitter } from './lifecycle-event-emitter'; function addLifecycleListener( listener: (state: ?LifecycleState) => void, ): EventSubscription { if (Platform.OS === 'android') { return getLifecycleEventEmitter().addLifecycleListener(listener); } - NativeAppState.addEventListener('change', listener); - return { - remove: () => { - NativeAppState.removeEventListener('change', listener); - }, - }; + return NativeAppState.addEventListener('change', listener); } function getCurrentLifecycleState(): ?string { return Platform.OS === 'android' ? getLifecycleEventEmitter().currentLifecycleStatus : NativeAppState.currentState; } export { addLifecycleListener, getCurrentLifecycleState };