Skip to content

react-native-hooks/back-handler

Repository files navigation

@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