@rnhooks/app-state
v0.0.2
Published
React Native hook for App State
Downloads
6
Readme
@rnhooks/app-state
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
- @pritishvaidya The main author.
Questions
Feel free to contact me or create an issue