meteor / react-packages

Meteor packages for a great React developer experience
http://guide.meteor.com/react.html
Other
573 stars 157 forks source link

react-meteor-data: handle.ready() is always false #361

Open derwaldgeist opened 2 years ago

derwaldgeist commented 2 years ago

According to the docs, this should work:

const listLoading = useTracker(() => {
    // Note that this subscription will get cleaned up
    // when your component is unmounted or deps change.
    const handle = Meteor.subscribe('todoList', listId);
    return !handle.ready();
  }, [listId]);

However, if I try it out, the returned value is always true, i.e. ready() is always false.

derwaldgeist commented 2 years ago

Note: I am using publishComposite in the background.

radekmie commented 2 years ago
  1. Does it work outside of useTracker? Like, in a standard Tracker.autorun?
  2. Does it work without the deps array (i.e., without the second useTracker argument)?
derwaldgeist commented 2 years ago

2. Does it work without the deps array (i.e., without the second useTracker argument)?

This did not change anything. I have yet to try out 1.