DEV Community

Discussion on: First Impressions: learning Angular after React/Redux

Collapse
 
jefftopia profile image
Jeff

Whether change detection triggers a render depends on how you’ve setup your Angular component’s change detection strategy. By default, Angular watches all template-bound properties and will re-render.

OnPush, by contrast, effectively memo’s Inputs (read: props), and only re-renders when an Input value or ref has changed.

Thread Thread
 
jenc profile image
Jen Chan

I just learned about using OnPush to optimize change detection last night. Having spent a few weeks with Angular now I'm less conflicted trying to connect the dots between React and Angular on what I'm confused by. It's taught like two separate schools of thought I can't reconcile yet. Frankly I'm not even sure which I prefer!