question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enabling screen causing swipe to go back issue on react-navigation

See original GitHub issue

When swiping from the edge to go back, the component at the edge of the screen also gets triggered, causing unexpected behaviour, this only happens with screen enabled. More details and reproduction can be seen in this issue: https://github.com/react-navigation/react-navigation/issues/9577

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tiencommented, Jun 18, 2021

@WoLewicki Looks like it was a caching issue, finally got it to work after completely wiping Pods. Thanks for your work on this library & the really fast bug response time. Have a good day.

2reactions
WoLewickicommented, Jun 15, 2021

I think I got to the root of this. Recently we made the container update async (https://github.com/software-mansion/react-native-screens/pull/777/files), which makes the registering of view from RNGH fail (https://github.com/software-mansion/react-native-gesture-handler/blob/master/ios/RNGestureHandlerManager.m#L134) since the view hierarchy is not ready because the asynchronous method of attaching view to container is fired after the register method. It works in v5 because the back button in header was taken from RNGH, and it is above the screens in hierarchy, so it managed to get to root view and attach the whole view https://github.com/react-navigation/react-navigation/blob/5.x/packages/stack/src/views/TouchableItem.ios.tsx#L3 It was changed in v6, cause it does not use RNGH for this button, so it stopped working there. We will work on resolving this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preventing going back - React Navigation
Disable the swipe gesture for the screen ( gestureEnabled: false ). Override the native back button in the header with a custom back...
Read more >
react-native-screens - npm
This project aims to expose native navigation container components to React Native. It is not designed to be used as a standalone library ......
Read more >
react-navigation swipe to go back doesn't trigger
I had the same problem and updating @react-navigation/stack to the latest version fixed it. my prev package.json with the issue
Read more >
detachinactivescreens | The AI Search Engine You Control
3. · detachInactiveScreens={true} cause onScroll of previous tab screen ... · Stack Navigator - React Navigation · Make YOU yours ✨.
Read more >
[Solved]-react navigation v6 and v5, Disable swipe back action
Coding example for the question react navigation v6 and v5, Disable swipe back action.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found