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>

It’s dense, it’s not flashy, but it’s really important for everybody working in Angular to understand how data binding syntax works.

<p foo="bar"> // literal string "bar"
<p [foo]="bar"> // property named "bar" in controller
<p [foo]="false"> // JavaScript literal `false` primitive
<p foo="false"> // literal string "false", as your error message is telling you
1 Like