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 diff --git a/package.json b/package.json index 42c8f0f..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": { @@ -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" } }