Swipe from left screen to pop
Closed this issue · 2 comments
jonathanglasmeyer commented
I wonder if this is possible? While i am able to drag the left screen edge to the right i don't know how to hook into it so that i can pop()
. Can't find any info on this.
jonathanglasmeyer commented
Some digging revealed that these changes in StackRouteView
kind of do what i'd want:
+ static contextTypes = {
+ router: PropTypes.object.isRequired,
+ };
// ....
// .....
renderTransition(props: NavigationTransitionProps): ReactElement<any> {
// ...
const scenes = props.scenes.map(
scene => this.renderScene({
...props,
+ onNavigateBack: () => {
+ requestAnimationFrame((): void => {
+ this.context.router.pop();
+ });
+ },
scene,
})
);
This is very clumsy of course and the animation is jerky. Are there ways to do this proper? :)
Edit: Testing this in Release mode, the animation is not that jerky anymore. :)