Skip to content

bug: Properties ionNavWillChange and ionNavDidChange do not exist on IonNav #28863

@projectormato

Description

@projectormato

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

Using Ionic version 7.5.0 or later, this code cause an error:

export interface HogeHogeNav { readonly navWillChange: IonNav['ionNavWillChange']; readonly navDidChange: IonNav['ionNavDidChange']; } 

The error message is:

Error TS2339: Property 'ionNavWillChange' does not exist on type 'IonNav'. readonly navWillChange: IonNav['ionNavWillChange']; 

Expected Behavior

No error if possible

Steps to Reproduce

  1. Write this code
export interface HogeHogeNav { readonly navWillChange: IonNav['ionNavWillChange']; readonly navDidChange: IonNav['ionNavDidChange']; } 
  1. run npm run build

Code Reproduction URL

No response

Ionic Info

Ionic: Ionic CLI : 7.2.0 Ionic Framework : @ionic/angular 7.5.0 @angular-devkit/build-angular : 15.2.9 @angular-devkit/schematics : 15.2.9 @angular/cli : 15.2.9 @ionic/angular-toolkit : 7.0.0 Cordova: Cordova CLI : not installed Cordova Platforms : not available Cordova Plugins : not available Utility: cordova-res : not installed globally native-run : not installed globally System: ios-sim : 8.0.2 NodeJS : v18.17.0 npm : 9.6.7 OS : macOS Unknown Xcode : Xcode 15.0.1 Build version 15A507 

Additional Information

In versions prior to 7.5.0, the IonNav interface was implemented like this:

export declare interface IonNav extends Components.IonNav { /** * Event fired when the nav will change components */ ionNavWillChange: EventEmitter<CustomEvent<void>>; /** * Event fired when the nav has changed components */ ionNavDidChange: EventEmitter<CustomEvent<void>>; } 

diff:
https://github.com/ionic-team/ionic-framework/pull/28311/files#diff-1fd76195dbb521bd6fc15558ddb677c06cd4a94d7541ecdea25409b875ea71daL1419-L1428

in version 7.5.0 and later, the implementation seems to have changed to:

// eslint-disable-next-line @typescript-eslint/no-empty-interface export declare interface IonNav extends Components.IonNav {} 

diff:
https://github.com/ionic-team/ionic-framework/pull/28311/files#diff-d84d2a25aef8d8c26050fe026186e82c53be36a44acd0c4343af76a671dfb58dR25-R26

Was this removal of ionNavWillChange and ionNavDidChange to IonNav interface intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions