facebookarchive / react-meteor

React rendering for Meteor apps
948 stars 114 forks source link

separate of logic from presentation not possible? #26

Closed Maxhodges closed 9 years ago

Maxhodges commented 9 years ago

I'm a Meteor dev and was curious about React, but from looking at the example it seems the approach results in very poor separation of presentation from logic. Is it necessary to sacrifice good design if you want to use React with Meteor?

https://github.com/reactjs/react-meteor/blob/master/examples/leaderboard/leaderboard.jsx#L33-L64

benjamn commented 9 years ago

This is a good question, but it's part of the React™ philosophy that separation of logic and presentation is not actually a worthwhile goal. Rather, your code should be organized into reusable UI components, which include both logic and presentation. Here's a presentation by @petehunt that goes through the reasoning (starting on slide 11): http://www.slideshare.net/floydophone/react-preso-v2