mediumConceptMidSenior
An Angular component with OnPush change detection has stopped updating when its data changes. Walk me through why, and how Vue avoids the same problem.
4 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup
Answer
Short answer
OnPush checks a component only when an input arrives with a new reference, a template event fires, an async pipe or signal it reads emits, or you mark it.Mutating an object in place satisfies none of those, so the view never gets checked.
Was this answer helpful?
Likely follow-ups
- A WebSocket handler in a service updates a field on a shared object. Which components re-render and which do not?
- You call detectChanges in a lifecycle hook and get an error about an expression changing after it was checked. What did you do wrong?
- Reading a signal in a template marks that view dirty. What does that change about whether you still need OnPush at all?
- In Vue, when does destructuring a reactive object lose reactivity, and what do you use instead?
Related questions
- Angular, Vue and React are answers to the same problems. Compare how each handles change detection, reactivity and dependency injection.hardAlso on angular and vue6 min
- Draw me the boundary between your monitoring system and the plant's safety system. How would you know if the safety layer had been altered?hardAlso on change-detection6 min
- Assign n tasks to n workers at minimum cost, with n up to 20. Why a bitmask, and what does it cost?hardSame kind of round: concept4 min
- Find the cheapest flight from one city to another using at most K stops. Why does plain Dijkstra give the wrong answer?mediumSame kind of round: concept5 min