Hello community. Using provideAnimations() I have created a lot of animations in different components. Now as I understand this function will be removed in v23
@deprecated — 20.2 Use animate.enter or animate.leave instead. Intent to remove in v23
What should I do now? I wanna keep my code with the last version of angular, but if you remove it. Doesn't it mean that my animations will stop working?
#provideAnimations() Deprication
2 messages · Page 1 of 1 (latest)
It will mean that your project won't compile in the first place because the necessary imports (animate, style, trigger, transition etc.) will no longer exist.
That is assuming you used angular's DSL to write your own animations like
import { animate, style, transition, trigger } from '@angular/animations';
export const fadeIn = trigger('fadeIn', [
transition(':enter', [
style({ opacity: 0 }),
animate('250ms ease-in', style({ opacity: 1 })),
]),
transition(':leave', [
style({ opacity: 1 }),
animate('250ms ease-out', style({ opacity: 0 })),
]),
]);
If that is the case, you'll have no other choice but to migrate to native css keyframe animations, which can do the same.