Comparison
Lifting state upvsTwo-way data binding
Lifting state up
two sibling components needed the same value, so you moved it into the parent they share.
Moving state to the closest common ancestor of the components that need it, and passing it back down. It is the standard fix for two components that must agree, and it is what turns a component into a controlled one. The cost is that the ancestor now re-renders on every change, taking its whole subtree with it unless something below is memoised.
Full entry →Two-way data binding
typing in the box changed the object and changing the object changed the box, and tracing which caused which was work.
A binding where updates flow in both directions between a view element and a model property. It removes an enormous amount of glue and makes the direction of causation unreadable, which is exactly why the one-way data flow argument won in the frontend and why it survived in desktop frameworks. Its worst failure is the update loop, where two bindings keep triggering each other.
Full entry →