DEV Community

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

Collapse
 
rogerpadilla profile image
Roger Padilla • Edited

Man, you should review what you are saying and comparing here. For example, hot reloading is not related at all with change detection

Collapse
 
jenc profile image
Jen Chan

Hmm yeah you're right, change detection listens for state changes and actually doesn't change the DOM. Hot reloading does the complete opposite...

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!

Collapse
 
jenc profile image
Jen Chan

Thanks. I intended to compare the difference between local dev on React with that on Angular. I'd like to hear what's wrong with my mental model.