Skip to content

Commit 35cab25

Browse files
authored
Update AppState usage to avoid deprecated API
1 parent d536c74 commit 35cab25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/onAppBackground.native.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ export default () => (persist: () => void) => {
1212
}
1313
};
1414

15-
AppState.addEventListener('change', listener);
16-
return () => AppState.removeEventListener('change', listener);
15+
const subscription = AppState.addEventListener('change', listener);
16+
return () => subscription.remove();
1717
};

0 commit comments

Comments
 (0)