facebookarchive / react-meteor

React rendering for Meteor apps
948 stars 113 forks source link

Small refactor to be more React-y #10

Closed yazaddaruvala closed 10 years ago

yazaddaruvala commented 10 years ago

The selected member of a collection is part of the state of that collection. The collection not the unit should then be responsible for selecting. Benefits, Meteor won't need to auto call setState on each Player component now. Instead the leaderboard collection component will try to rerender each Player and React can prune away any changes that aren't needed.

Also changed <Player id= to <Player key= as mentioned in the React docs.

benjamn commented 10 years ago

Thanks very much!