@rnhooks/back-handler

0.0.2 • Public • Published

@rnhooks/back-handler Build Status Maintainability module formats: umd, cjs, esm

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

Questions

Feel free to contact me or create an issue

Package Sidebar

Install

npm i @rnhooks/back-handler

Weekly Downloads

6

Version

0.0.2

License

MIT

Unpacked Size

15.9 kB

Total Files

11

Last publish

Collaborators

  • divyanshu013
  • pritishvaidya