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.

Swipeable not working with react-navigation/native-stack

See original GitHub issue

Description

Hello, I recently upgraded react-navigation v4 to v6 and my Swipeable gesture stopped working since then. After some manual git bisect I found that passing from @react-navigation/stack to @react-navigation/native-stack was the problem. I am using Android only so I don’t really know if it’s not working either for iOS.

Platforms

  • iOS
  • Android
  • Web

Steps To Reproduce

  1. Create main native stack + nested native stack
  2. add a Swipeable to a screen inside that nested stack
  3. Running on Expo android simulator works fine, but swipeable is not responding on real device

Snack or minimal code example

https://snack.expo.dev/@aqmebrak/swipeable-bug

Package versions

“react-native-screens”: “3.10.1”, “@react-navigation/native”: “^6.0.6”, “@react-navigation/routers”: “^6.1.0”, “@react-navigation/native-stack”: “^6.0.6”, “react-native-gesture-handler”: “1.10.3”, “react-native-safe-area-context”: “3.3.2”

  • React: 17
  • React Native: 0.64.3
  • React Native Gesture Handler: 1.10.3
  • React Native Reanimated: -

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
j-piaseckicommented, Mar 10, 2022

Could you check if wrapping your app with GestureHandlerRootView solves the issue for you? It can be done like so:

+ import { gestureHandlerRootHOC } from 'react-native-gesture-handler';
...
- registerRootComponent(App);
+ registerRootComponent(gestureHandlerRootHOC(App));
1reaction
kmagieracommented, Mar 31, 2022

Happy to hear that suggestion resolved the issue. I though that when no root view is present we detect that and show some special error, is that not the case @j-piasecki ?

Also, I understand we can consider this issue resolved, so it should be safe to close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swipe back is not working · Issue #6809 · react-navigation ...
swipe back is not work on iOS 13. Expected Behavior. It should work line in stack navigator. How to reproduce.
Read more >
Swipe Gesture not working in React Navigation v6 in IOS build
The open/close function on a button click is working fine but Swipe gesture is not responding.
Read more >
Stack Navigator | React Navigation
Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a stack....
Read more >
Swipeable is not working on android? - React Native
here is my MessagesScreen.js import React from 'react'; import { FlatList, StyleSheet, View} from 'react-native'; import ListItem from '.
Read more >
react-native-swipeable-tabs - npm package - Snyk
Learn more about react-native-swipeable-tabs: package health score, popularity, ... or change in issues status has been detected for the GitHub repository.
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