September 2018
Beginner
156 pages
3h 28m
English
By default, when you press the back button on an Android device, the application exits instead of navigating the user to the previous state in the history. The React Native library includes a BackHandler class, which lets you customize the behavior of the devices' hardware back button. The <BackButton> component in React Router uses the BackHandler class to customize the behavior of the back button on an Android device:
import { NativeRouter, BackButton } from 'react-router-native';export default class App extends Component { render() { return ( <NativeRouter> <View style={styles.container}> <BackButton /> <SideMenu menu={menu}> <ContentView /> </SideMenu> </View> </NativeRouter> ) }}
The <BackButton> component ...
Read now
Unlock full access