Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 319 Bytes

useBackHandler.md

File metadata and controls

16 lines (11 loc) · 319 Bytes

useBackHandler

React Native API 🎣 that adds an event listener for the BackHandler hardwareBackPress event given a callback to use.

Usage

import {useBackHandler} from 'react-native-use'

const handleBackPress = () => {
  this.goBack();
  return true;
}

useBackHandler(handleBackPress);