facebookarchive / react-meteor

React rendering for Meteor apps
948 stars 113 forks source link

Reactivity fails when props are changed #27

Closed liron00 closed 9 years ago

liron00 commented 9 years ago

Thanks for a great package, I've been using it to great success. Unfortunately I just discovered it has a pretty major bug.

The current implementation assumes that this._meteorComputation is dependent on whatever set of reactive data sources were accessed when getMeteorState was run at mount-time.

If props are changed, getMeteorState is re-run but not in a reactive context. The problem is that getMeteorState may access a dynamic set of reactive variables that depend on the current prop values, so the reactivity stops working once props are changed.

benjamn commented 9 years ago

You're right! This will be fixed soon.

liron00 commented 9 years ago

Cool. Btw, I rolled my own Meteor-React integration which is much more elaborate.

Check out this demo: http://busterbros.meteor.com/ It's powered by this source code: http://pastebin.com/32qdGAXQ