Hacker News new | ask | show | jobs
by gravity13 3959 days ago
Sure, but it suggests a component hierarchy which blurs the already ambiguous line between view and controller. Which is why there's flux and all of its variants, and things like falcor in the works - the missing model in data-component architecture.
1 comments

On the ambiguous line between view and controller: a piece of code belongs to the controller when it touch the model, and to the view when it touch the DOM, the corollary being "don't write code that touch both the controller and the model". Put that way it doesn't seems that ambiguous.

The fact that react suggests you organize the views in a component's hierarchy has nothing to do, imho, with people calling the models from those components. It's just bad practices, whatever is the view library being used.

But I get your point nonetheless: flux & all do try to make it clearer that react should only get called from events and update the DOM as a consequence.

For the record, there's also good things being done in that field by the clojurescript community (Om/Reagent for example).