Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Cannot reattach ActivatedRouteSnapshot created from a different ... #2279

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

Draft
edusperoni wants to merge 1 commit into NativeScript:master
base: master
Choose a base branch
Loading
from edusperoni:activated-route-fix

Conversation

@edusperoni
Copy link
Collaborator

@edusperoni edusperoni commented Oct 19, 2020

...route

PR Checklist

What is the current behavior?

Navigating between sibling routes may sometimes mess with the cache due to it using the key of a parent route, instead of the complete route.

What is the new behavior?

This now uses the correct key from the farthest children of the route

PARTIALLY Fixes #1993. (this issue has 2 problems on it: 1 is the one fixed in this PR, the other is that route guard/resolvers don't work on back navigation and may break navigation for a PRO)

MenchenFive reacted with thumbs up emoji
Copy link
Collaborator Author

Please don't merge this yet, as it seems it might not fully solve the issue

MenchenFive reacted with thumbs up emoji

Copy link

@edusperoni @NathanaelA
When debugging this issue in the use case Root => A => B, then back to A it looks like all keys to store/retrieve are generated correctly (also without this fix), but the error is still thrown.
The expression that causes the error to be thrown (curr.value.routeConfig !== result.value.routeConfig in https://github.com/angular/angular/blob/3817e5f1dfeb9de26fa2ea4068a37565f435214f/packages/router/src/create_router_state.ts#L52) will actually show equal properties and values when inspecting, but are not the same object reference. This only occurs with lazy loaded modules (if changed to "regular" route configs it works).
Perhaps the solution direction for this part of the issue is to either use a "deepEqual" instead of reference equality or to somehow make sure that the routeConfig reference stays the same for lazy loaded modules.
Hope this helps, cheers.

MenchenFive reacted with thumbs up emoji

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

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cannot reattach ActivatedRouteSnapshot created from a different route

AltStyle によって変換されたページ (->オリジナル) /