0.0.2 • Published 5 years ago

@rnhooks/app-state v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@rnhooks/app-state Build Status Maintainability

React Native hook for App State

import useAppState from '@rnhooks/app-state';

function App() {
  const { status, foreground } = useAppState();
  return (
    <View style={styles.container}>
      <Text style={styles.type}>{`App State: ${status}`}</Text>
      <Text style={styles.type}>{`Foreground: ${foreground}`}</Text>
    </View>
  );
}

Output

NameTypeDefaultDescription
statusactive / background / inactiveAppState.currentStateCurrent App Status
foregroundbooleantrueIs foreground or not

Contribution

Questions

Feel free to contact me or create an issue