|
|
|
|
|
by tipiirai
4172 days ago
|
|
Virtual DOM implementation is indeed different. The biggest reason for calling it "React-like" is the basic idea of components, where related HTML and JS are combined together. > "Build components, not templates" http://www.slideshare.net/floydophone/react-preso-v2 I think this is the "what" of React and virtual DOM is the "how". |
|
The difference between React and other databinding methods is that you can use all JS language features (i.e. if, for, while, .filter(), .map(), libraries like Rx.js, etc.) when defining what you want your DOM to look like.
Suppose I want to have a list of items based on some array, which I want to filter based on some predicate, and display the items differently based on their content type.
In a React render() function I would just use
to filter unwanted items, and to map the individual items to how I want them to look like.To me it looks like to implement something like this in Riot would require to build / use something that is more like Angular's computed properties.
But I'd like to be proven wrong.