From 194736384d48bf05b9b14f0c2758af23cc0a1f27 Mon Sep 17 00:00:00 2001 From: Addin Gama Bertaqwa Date: Wed, 20 Apr 2022 07:55:57 +0800 Subject: [PATCH 1/3] Improve peerDependencies to support latest RN --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 42c8f0f..b627467 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/amrlabib/react-native-appstate-hook#readme", "peerDependencies": { - "react": "^16.8.0", - "react-native": "^0.59.0" + "react": ">=16.8.0", + "react-native": ">=0.59.0" } } From 25b405e7ddbc7584252529f17706ce789df9290e Mon Sep 17 00:00:00 2001 From: Addin Gama Bertaqwa Date: Wed, 20 Apr 2022 08:14:54 +0800 Subject: [PATCH 2/3] Fix remove event listener --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 1200bee..fe49e29 100644 --- a/dist/index.js +++ b/dist/index.js @@ -17,7 +17,7 @@ export default function useAppState(settings) { } const appState = AppState.addEventListener('change', handleAppStateChange); - return () => appState.remove(); + return () => AppState.removeEventListener('change', handleAppStateChange); }, [onChange, onForeground, onBackground, appState]); // settings validation From 69d387e13cfab93d02284cc6e7f71ccaced45ad6 Mon Sep 17 00:00:00 2001 From: Addin Gama Bertaqwa Date: Wed, 20 Apr 2022 08:15:21 +0800 Subject: [PATCH 3/3] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b627467..9edb4e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-appstate-hook", - "version": "1.0.6", + "version": "1.0.7", "description": "React Native appState hook", "main": "dist/index.js", "scripts": {