0.0.2 • Published 5 years ago

@rnhooks/back-handler v0.0.2

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

@rnhooks/back-handler Build Status Maintainability

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

NameTypeDefaultDescription
backhandlerfunction \ stringexitEither provide with custom back handler method or exit string to exit the app

Output

NameTypeDefaultDescription
countNumber0Back press count

Contribution

Questions

Feel free to contact me or create an issue