Search code examples
ionic-frameworkionic5

ion-router animated Type 'string' is not assignable to type 'boolean'


I am trying to disable animation on my ionic 5 project. Searching through web I found a way to disable it by using animated="false" in ion-router-outlet. It does disable the animation but when I try to build in production it gives me the following error.

     ionic capacitor build android --prod

     Error: src/app/app.component.html:114:35 - error TS2322: Type 'string' is not assignable to type 'boolean'.

     <ion-router-outlet id="content" animated="false" ></ion-router-outlet>

Solution

  • animated is a boolean property so you'll have use property binding:

    <ion-router-outlet id="content" [animated]="false"></ion-router-outlet>