4 ms·
Nope. Lack of two-way binding is a blessing. It makes everything predictable. >It seems going back to the method of handling data updates through onchange even
by danabramov 12y ago
Nope. Lack of two-way binding is a blessing. It makes everything predictable.
>It seems going back to the method of handling data updates through onchange events in a manual fashion would be a colossal step backwards from say, knockoutjs.
It's not exactly "manual fashion" because React updates everything according to `state` for you. If you have many interdependent fields, make them update `state` correctly, and React will keep them in sync with it.
In fact I find it easier to make complex input logic with one-way bindings because the data always flows one way. It's a tad more code to write, but you see exactly where your updates are happening and what's causing them.
Two-way binding tends to get very complicated as soon as you need more complex logic. One-way binding doesn't have this problem.
- nightski 12y agoI'm not sold two-way binding tools get inherently complicated, I just haven't seen this increase in complexity in our current app which is quite large. But I am attracted to react for the reasons you mention, the virtual DOM aspect is very nice so I'll give this a shot. Although even though ReactLink works it a.) feels like quite the hack (i.e. not very composable) and b.) is a more code to maintain still when it comes down to it.