Why does React emphasize on unidirectional data flow and Flux architecture?

Two way data binding leads to updates that are unpredictable. Imagine how Angular handles this - through dirty checking! This is super slow and counter productive - not to mention the max 10 apply cycle limit. Although this will be solved via Object.observe in Angular 2.0, in my opinion bi-directional binding is not the best way to handle data flow in most cases.

By keeping the data flow unidirectional you keep a single source of truth i.e. Store. Your views are just the functions of the application state. Change the state and your view changes. This is way more predictable and gives you a clear idea about how different components react to state change.

Write a reply...

Never miss an answer from James B,
when you sign up for Hashnode. Learn more

loading ...