MCPcopy Index your code
hub / github.com/TanStack/query / useAppState

Function useAppState

examples/react/react-native/src/hooks/useAppState.ts:5–12  ·  view source on GitHub ↗
(onChange: (status: AppStateStatus) => void)

Source from the content-addressed store, hash-verified

3import type { AppStateStatus } from 'react-native'
4
5export function useAppState(onChange: (status: AppStateStatus) => void) {
6 useEffect(() => {
7 const subscription = AppState.addEventListener('change', onChange)
8 return () => {
9 subscription.remove()
10 }
11 }, [onChange])
12}

Callers 1

AppFunction · 0.90

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…