Function
useAppState
(onChange: (status: AppStateStatus) => void)
Source from the content-addressed store, hash-verified
| 3 | import type { AppStateStatus } from 'react-native' |
| 4 | |
| 5 | export function useAppState(onChange: (status: AppStateStatus) => void) { |
| 6 | useEffect(() => { |
| 7 | const subscription = AppState.addEventListener('change', onChange) |
| 8 | return () => { |
| 9 | subscription.remove() |
| 10 | } |
| 11 | }, [onChange]) |
| 12 | } |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…