3 ms·
idea of expressing your UI as a pure function of the form f(data) = view and being able to compose those functions together. This is a verbose re-statement of
by msane 10y ago
idea of expressing your UI as a pure function of the form f(data) = view and being able to compose those functions together.
This is a verbose re-statement of components, which are not new.
Before React, you couldn't do this in a performant, UX-positive way
Has there never been a performant component based UI framework?
- peterhunt 10y agoMaybe I wasn't clear. The big idea is not components. The big idea is expressing your view hierarchy as a single snapshot in time, and when the data changes you conceptually throw out the old view hierarchy and re-render from scratch and React manages the native view updates to ensure that it's fast and doesn't adversely affect the UX by, say, resetting scrollbar position. Contrast this with two previous approaches. The first is where you have a component hierarchy that renders the initial state of the view, but when the data changes you need to write imperative code to transition the native views to reflect the new state. The second is traditional data binding, which doesn't help when you want to change the view hierarchy itself (rather than properties of existing views) based on an underlying data change.