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

"Maximum update depth exceeded ... infinite loops" error when unstable_settings.initialRouteName and Stack.Screen set title #670

Open
ericfong opened this issue Jun 19, 2023 · 5 comments
Labels
external Issue cannot be solved by modifying the code in this repo

Comments

@ericfong
Copy link

Which package manager are you using? (Yarn is recommended)

npm

Summary

  • happen when npm run web
  • either comment out unstable_settings.initialRouteName or Stack.Screen(title) will work
  • seems can work around by delay setOptions or <Stack.Screen options={{ title: "Blog" }} />

Minimal reproducible example

min reproducible repo
https://github.com/ericfong/expo-router-bug

  • npm run web
  • click 'First Blog' link
  • hit 'Maximum update depth exceeded'
image
@marklawlor
Copy link
Contributor

marklawlor commented Jun 22, 2023

app/blogs/_layout.js has an invalid initialRouteName, as a route with the name index does not exist (only [id] does).

export const unstable_settings = {
-  initialRouteName: "index",
+  initialRouteName: "[id]",
};

@ericfong
Copy link
Author

sorry, I missed blogs/index.js
I have added it back to https://github.com/ericfong/expo-router-bug/blob/main/app/blogs/index.js

still can hit 'Maximum update depth exceeded'

@EvanBacon EvanBacon added the external Issue cannot be solved by modifying the code in this repo label Jul 14, 2023
@EvanBacon
Copy link
Contributor

I've added the external label because this seems to be a React Navigation bug, however we could possibly work around it in user-space.

@vinodsptharsha
Copy link

Do you have any updates on the issue? I also encounter the same problem after upgrading to SDK 49 and router v2.

@vinodsptharsha
Copy link

My issue was with the authentication flow. I was able to solve this issue with the help of https://dev.to/aaronksaunders/expo-router-v2-authentication-flow-with-appwrite-jee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Issue cannot be solved by modifying the code in this repo
Projects
None yet
Development

No branches or pull requests

4 participants