@rnhooks/back-handler
v0.0.2
Published
React Native hook for Back Handler
Downloads
46
Readme
@rnhooks/back-handler
React Native hook for Back Handler
import useBackHandler from '@rnhooks/back-handler';
function backhandler () {
// ... Custom Setup
}
function App() {
const count = useBackHandler(backhandler);
return (
<View style={styles.container}>
<Text style={styles.type}>{`Count: ${count}`}</Text>
</View>
);
}
Input
| Name | Type | Default | Description |
| :------------ | :------------------ | ------: | :-------------------------------------------------------------------------------|
| backhandler
| function \ string
| exit
| Either provide with custom back handler method or exit
string to exit the app |
Output
| Name | Type | Default | Description |
| :---- | :----- | -------:| :----------------|
| count | Number | 0
| Back press count |
Contribution
- @pritishvaidya The main author.
Questions
Feel free to contact me or create an issue