Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private handleGoBack = ({ route }: { route: Route }) => {
const { state, navigation } = this.props;
// This event will trigger when a gesture ends
// We need to perform the transition before removing the route completely
navigation.dispatch({
...StackActions.pop(),
source: route.key,
target: state.key,
});
};
export function pop({ n = 1 }: { n: number }): StackActionType {
return StackActions.pop(n);
}
? () =>
navigation.dispatch({
...StackActions.pop(),
source: scene.route.key,
})
: undefined
onDismissed={() => {
navigation.dispatch({
...StackActions.pop(),
source: route.key,
target: state.key,
});
}}
>