0

Why does Angular’s OnPush change detection improve performance, and when should you avoid it?

author
subina kallyani
medium
0
25

Answer

OnPush makes Angular skip re-checking a component unless:

  • An @Input() reference changes
  • An event is triggered inside
  • A manual markForCheck() runs
    Avoid it if your component relies on deep object mutations or shared mutable state.

Click to Reveal Answer

Tap anywhere to see the solution

Revealed

Comments0
    Why does Angular’s OnPush change detection improve performance, and when should you avoid it? - performance | EBAT