Update useIsForeground.ts
This commit is contained in:
parent
d3fbf6700e
commit
1f3de955c7
@ -6,7 +6,7 @@ export const useIsForeground = (): boolean => {
|
|||||||
const [isForeground, setIsForeground] = useCachedState(true);
|
const [isForeground, setIsForeground] = useCachedState(true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const onChange = (state: AppStateStatus) => {
|
const onChange = (state: AppStateStatus): void => {
|
||||||
setIsForeground(state === 'active');
|
setIsForeground(state === 'active');
|
||||||
};
|
};
|
||||||
AppState.addEventListener('change', onChange);
|
AppState.addEventListener('change', onChange);
|
||||||
|
Loading…
Reference in New Issue
Block a user