Skip to content

bug: NavPush Constructs @Page each Time. NeverDestroyed #5507

@Barryrowe

Description

@Barryrowe

Type: bug

Ionic Version: 2.x

Platform: all

When an @page component is navigated too via a NavController.push or .setRoot, a new Instance of the component is created (it's constructor() fires). However, when the page is navigated away from, it is never destroyed (onPageWillUnload and onPageDidUnload never fire). The next time you navigate to the same type of component, another new instance is created, rather than re-using the instance that has never been disposed.

If the intention is that a new instance should be created each time, it needs to be disposed properly, or there is a memory leak issue.

If the intention is that a single instance should be created and re-used when the type is navigated too, then this is currently broken.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions