inProgress-team / react-native-meteor

Meteor Reactivity for your React Native application :)
MIT License
693 stars 210 forks source link

Only changes to the subscription data triggers a re-render #257

Open jamesloper opened 7 years ago

jamesloper commented 7 years ago

I have some basic boilerplate code --

export default createContainer(function(params) {
    var handle = Meteor.subscribe('Feed');

    return {
        'currentUser': Meteor.user(),
        'ready': handle.ready(),
    };
}, Home);

I also have a <MeteorListView> where the renderRow method includes references to currentUser.

However, the dataSource supplied to by <MeteorListView> only references the Mongo live query data. Since it doesn't reference Meteor.user(), only changes to the subscription data will cause a re-render.

Can we start a discussion about this?

I offer one solution- the internal dataSource could be altered to invalidate when Meteor.user() changes?