@rnhooks/app-state

0.0.2 • Public • Published

@rnhooks/app-state Build Status Maintainability module formats: umd, cjs, esm

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

Name Type Default Description
status active / background / inactive AppState.currentState Current App Status
foreground boolean true Is foreground or not

Contribution

Questions

Feel free to contact me or create an issue

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    2

Package Sidebar

Install

npm i @rnhooks/app-state

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

18 kB

Total Files

11

Last publish

Collaborators

  • divyanshu013
  • pritishvaidya