Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo keeps restarting when user navigate to another screen or is navigated #11815

Open
4 of 12 tasks
kasir-barati opened this issue Feb 7, 2024 · 9 comments
Open
4 of 12 tasks

Comments

@kasir-barati
Copy link

kasir-barati commented Feb 7, 2024

Current behavior

I have a drawer with a initialRouteName and when user opens app they go to that screen, there I am checking something asynchronously and then based on the result I wanna redirect user to another screen or keep them there (this initialRouteName is registration page and the next page that I wanna redirect the user to it is home) but as of now it tries to navigate user to the destination page but it will keep restarting and cannot go there 🤔 😕

Expected behavior

Just open home screen 💢

Reproduction

https://github.com/kasir-barati/solo-trainee

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
  • react-native-tab-view

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/drawer ^6.6.7
@react-navigation/native ^6.1.10
@react-navigation/native-stack ^6.9.18
react-native-safe-area-context 4.8.2
react-native-screens ~3.29.0
react-native-gesture-handler ~2.14.0
react-native-reanimated ~3.6.2
react-native 0.73.4
expo ~50.0.6
node 20.10.0
npm 10.4.0
@kasir-barati
Copy link
Author

Please note that I am using Expo and not android studio

@mihailapuste
Copy link

Also having the same issue, using latest expo and navigation 7

@kasir-barati
Copy link
Author

kasir-barati commented Feb 8, 2024

IDK what exactly has changed since this commit but if you go back to it, application works just fine. What I do not get is why is it like that since I could not see any significant change between my latest commit and this commit 😕.

Also when I change the version of packages back to what they were in that commit, I get another warning:

"dependencies": {
    "expo": "~50.0.5",
    "react-native": "0.73.2",
},
"devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.2.45",
}

Warning:

warning: Bundler cache is empty, rebuilding (this may take a minute)
The following packages should be updated for best compatibility with the installed expo version:
  react-native@0.73.2 - expected version: 0.73.4
Your project may not work correctly until you install the correct versions of the packages.

But the issue is that when I upgrade it it won't change anything 😢

@kasir-barati
Copy link
Author

And this is what I get when I try to run it in the browser:
image
I believe it has certainly something to do with the way that navigation.navigate('Home'); works.

@kasir-barati
Copy link
Author

I had to kill the browser process in linux in order to stop it.

@kasir-barati
Copy link
Author

Even when I comment these lines navigation.navigate('Home'); and try to navigate to other screens via drawer I caught in the same annoying buggy behavior.

@kasir-barati kasir-barati changed the title Expo keeps restarting when I am redirecting user to another screen Expo keeps restarting when user navigate to another screen or is navigated Feb 9, 2024
Copy link

github-actions bot commented Feb 9, 2024

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • @react-navigation/drawer (found: 6.6.6, latest: 6.6.7)
  • @react-navigation/native (found: 6.1.9, latest: 6.1.10)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

@kasir-barati
Copy link
Author

I have upgraded all of them and still they exists

@kasir-barati
Copy link
Author

BTW I've asked it here in Stackoverflow too, so feel free to follow that one too, if anybody was up for the challenge to answer my question 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants