ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Lifecycle events called in wrong order

Open georgechr opened this issue 6 years ago • 4 comments

Bug Report

Ionic version: [x] 4.0.0

Current behavior: When changing the root page the lifecycle events of the previous and next page seem to fire out of order. So, lets say page A is currently displayed. Navigating to page B fires the lifecycle events in the following order:

  1. Page B: ngOnInit
  2. Page B: ionViewWillEnter
  3. Page B: ionViewDidEnter
  4. Page A: ngOnDestroy

(ionViewWillLeave and ionViewDidLeave do not fire at all)

Expected behavior: I would expect that page A fires ngOnDestroy or ionViewWillLeave or ionViewDidLeave before page B's 'enter' events

georgechr avatar Feb 04 '19 07:02 georgechr