ionic-team / ionic-team/ionic-framework

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

Ouverte
#30,644 3 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
triage
Langage dominant
TypeScript
Étoiles
52.7k
Forks
13.3k
Merge moyen
1 j 15 h
PR mergées (30 j)
51

Description

### 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_

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by running the linked StackBlitz reproduction and follow the A(III) → B → browser-back navigation while watching the console logs. Compare the lifecycle events for Page A and A(III); the work is done when A(III)'s expected Ionic lifecycle hooks trigger after returning to it.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend, mobile
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.