Skip to content

Instantly share code, notes, and snippets.

@nazrdogan
Created February 11, 2019 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazrdogan/2ad5617a499bd04402f41280843aa114 to your computer and use it in GitHub Desktop.
Save nazrdogan/2ad5617a499bd04402f41280843aa114 to your computer and use it in GitHub Desktop.
import React from 'react';
import { Button } from 'react-native';
import { withNavigation } from 'react-navigation';
class MyBackButton extends React.Component {
render() {
return <Button title="Back" onPress={() => { this.props.navigation.goBack() }} />;
}
}
// withNavigation returns a component that wraps MyBackButton and passes in the
// navigation prop
export default withNavigation(MyBackButton);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment