-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Deep link not working when nesting have more than two levels. #1950
Comments
Any solutions to this ? |
Could you put together a running example of this issue? Thanks! |
Yep — can confirm. The culprit seems to be related to mixing actions into state in https://github.com/react-community/react-navigation/blob/master/src/routers/StackRouter.js#L98 // Set up the initial state if needed
if (!state) {
let route = {};
if (
action.type === NavigationActions.NAVIGATE &&
childRouters[action.routeName] !== undefined
) {
return {
index: 0,
routes: [
{
...action,
type: undefined,
key: `Init-${_getUuid()}`,
},
],
};
}
// etc...
} This seems like a really weird design where actions are being splatted into state, does anyone know the origin of this? Is it intentional? |
Pinging OP @Kevin-Wolf since this issue has not been active for a while, and it's related to an old version of the lib. Please let me know if you want this to remain open, because if I get no answer in the next 7 days I will close it. |
…re than two levels.)
This is some quirky StackRouter behavior similar to what I addressed in TabRouter in #3094. I agree that information from the first action should not leak into the initialization of the child routes. |
…re than two levels.)
Now, I want to navigate in the following flow:MyRoot(Splash)->MyRoot(Home/Homework)->HomeworkDetails(I have two button in this component for navigating to Completed and NotCompleted)->Completed It is working in emulators. But after generating *.apk and installed on real device. When i click the Completed Button, app keeps stopping!! I am stucking with it past 3days. I am not able to understand this. |
How sure are you that you’re actually generating a new APK each time? If this issue isn’t reproable in an emulator or simulator, the issue is likely in the build process. Try making an obvious change, rebuilding the APK, and seeing if the change is reflected in the new build. |
@Ashoat Thanks for your quick reply. But, I am sorry..I have tried to build new apk lot of times. Nothing worked for me..:(( When building new apk, all other changes except this two navigation are reflecting in my new apk. |
@Ashoat I am sorry. Problem was in my side only. There was a problem in fonts and date format.It was worked in emulator:( not in real device..Anyhow i solved:)) Thank You |
Hello. I am receiving an error when trying to navigate via deep link to a two-level nested router, I am receiving this error:
This is my Root navigator.
This is my LoggedOut navigator.
And this is my SignUp navigator.
So as you see, if I try to navigate to
my-app://logged-out/welcome
ormy-app://logged-out/sign-in
it doesn't have a problem, since the stack isStackNavigator -> StackNavigator -> Component
.But, if I try to navigate to any sub-route of
sign-up
, for example,my-app://logged-out/sign-up/phone
, I receive the red screen error, since the stack isStackNavigator -> StackNavigator -> StackNavigator -> Component
.Anyone have the same issue? Any ideas to fix it? Is it some configuration I am missing out?
The text was updated successfully, but these errors were encountered: