diff --git a/lib/useAppState.js b/lib/useAppState.js index 83349a26..52d8414d 100644 --- a/lib/useAppState.js +++ b/lib/useAppState.js @@ -1,9 +1,9 @@ import React, { useEffect, useState } from 'react' import { AppState } from 'react-native' -const currentState = AppState.currentState - +// https://github.com/facebook/react-native/issues/18836 export default () => { + const currentState = AppState.currentState const [appState, setAppState] = useState(currentState) function onChange (newState) { @@ -19,4 +19,4 @@ export default () => { }) return appState -} \ No newline at end of file +}