Update useIsForeground.ts

This commit is contained in:
Marc Rousavy 2021-02-22 12:28:56 +01:00
parent d3fbf6700e
commit 1f3de955c7

View File

@ -6,7 +6,7 @@ export const useIsForeground = (): boolean => {
const [isForeground, setIsForeground] = useCachedState(true);
useEffect(() => {
const onChange = (state: AppStateStatus) => {
const onChange = (state: AppStateStatus): void => {
setIsForeground(state === 'active');
};
AppState.addEventListener('change', onChange);