Skip to content

fix: View not added to this instance. #2187

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

Closed
wants to merge 2 commits into from
Closed

fix: View not added to this instance. #2187

wants to merge 2 commits into from

Conversation

CatchABus
Copy link

@CatchABus CatchABus commented Jun 29, 2020

PR Checklist

What is the current behavior?

When pressing 'back' to exit application, an Activity-related exception is thrown.
This behaviour is also met when creating a basic angular application using 'tns create'.
So far, it's confirmed in android platform.

What is the new behavior?

Exception issues will be fixed using a small hack. It would be great if AppHostView parent behaviour was improved in the future.

Fixes: NativeScript/NativeScript#8667

@cla-bot cla-bot bot added the cla: yes label Jun 29, 2020
@CatchABus CatchABus changed the title fix: https://github.com/NativeScript/NativeScript/issues/8667 fix: View not added to this instance. View: ProxyViewContainer(8) CurrentParent: Page(4) ExpectedParent: AppHostView(1) Jun 29, 2020
@CatchABus CatchABus changed the title fix: View not added to this instance. View: ProxyViewContainer(8) CurrentParent: Page(4) ExpectedParent: AppHostView(1) fix: View not added to this instance. Jun 29, 2020
@CatchABus
Copy link
Author

CatchABus commented Jun 30, 2020

This fix helps page-router-outlet remove the temporary presence of a component from AppHostView.
This occurs when page-router-outlet is the direct child of root view.
My '_addView' addition cooperates with the following line to ensure that component is passed from one parent to another with success: https://github.com/NativeScript/nativescript-angular/blob/master/nativescript-angular/router/page-router-outlet.ts#L374

I tested it and had no issues, but still I'm not an Angular expert so I ask that my contribution is tested thoroughly.

@CatchABus
Copy link
Author

I'm closing this since NS team has done some amazing work on Angular, including a fix for this issue.

@CatchABus CatchABus closed this Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error destroy activity when I close the app with the back button
1 participant