ionic-team / ionic-team/ionic-framework

bug: Ionic life cycle hooks are not triggering in routed component

未关闭
#30,644 3 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
triage
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [x] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [x] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

Image

"When I navigate from A(III) to B and then back to A(III), the Ionic lifecycle hooks inside A(III) are not being called, but the lifecycle hooks of Page A are being triggered.

### Expected Behavior

Expecting Life cycle hooks in page A (III) to be triggered.

### Steps to Reproduce

_Note: Please keep browser console open to view the logs_

1. Go to page A (Now, in my demo application it will navigate to page A(III) by default in page A)
2. Now from A(III), go to page B
3. Now go back with browser back navigation to page A(III)

Now, If you see the browser you can only see page A ionViewWillEnter is only being triggered, but page A(III) ionViewWillEnter didn't triggered

### Code Reproduction URL

https://stackblitz.com/github/Av1nag/ionic-routing-demo-app

### Ionic Info

Ionic:

Ionic CLI : 7.2.0 (/Users/avinag/.nvm/versions/node/v18.20.5/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 8.7.2
@angular-devkit/build-angular : 20.1.6
@angular-devkit/schematics : 20.1.6
@angular/cli : 20.1.6
@ionic/angular-toolkit : 12.3.0

Utility:

cordova-res : 0.15.4
native-run : 2.0.1

System:

NodeJS : v18.20.5 (/Users/avinag/.nvm/versions/node/v18.20.5/bin/node)
npm : 10.9.1
OS : macOS Unknown

### Additional Information

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。