Menu

After the Angular 22 upgrade, grep for this first
📰

After the Angular 22 upgrade, grep for this first

DEV Community: angular·Mohammad Khalifeh·1 day ago
#5conKmJ8
#devtoangular#devto#dev#list#doesn
Reading 0:00
15s threshold
Cover image for After the Angular 22 upgrade, grep for this first

Mohammad Khalifeh

The build is green, the tests pass, and a list still doesn't refresh after saving. The usual cause: a plain class field changed inside subscribe().

With OnPush as the default and zoneless change detection, Angular only re-renders when it is told something changed. A signal tells it. A bare this.items.push(saved) doesn't, so the data is right and the screen is stale.

Fix: keep the state in a signal and use items.update(list => [...list, saved]).

The other places this hides (reactive forms, third-party callbacks, NgZone.onStable) are in the longer write-up: https://mkcodestudio.com/en/insights/angular-22-screen-not-updating-onpush-zoneless?utm_source=devto&utm_medium=quickpost