inProgress-team / react-native-meteor

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

how to migrate to withTracker #311

Closed ketankulkarni closed 6 years ago

ketankulkarni commented 6 years ago

I have been using createContainer but now I want to migrate to withTracker. From the documentation I used Tracker

import Meteor, { Tracker } from "react-native-meteor";
export default Tracker(() => {
  Meteor.subscribe("showCredit");
  return {
    credit:
      Meteor.collection("credit").find(
        {},
        { sort: { createdAt: -1 }, limit: 5 }
      ) || []
  };
}, SendMoney);

output - (0, _reactnativeMeteor.Tracker) is not a function

charpeni commented 6 years ago

I'm not sure how Tracker or even composeWithTracker works, but i'm sure this won't work out of the box as withTracker.

I'll be also interested to migrate to withTracker instead of the deprecated createContainer, unfortunately I can't check this right now. Let me know if you find a solution before I do.

ketankulkarni commented 6 years ago

@charpeni sure

charpeni commented 6 years ago

Good news, I finally got some time to work on this.

withTracker was introduced in #313 and is now available in react-native-meteor@1.3.0. :tada: