Closed dfuchs2512 closed 1 year ago
Duplicate of https://github.com/meteor/react-packages/issues/351 (which possibly has the same cause than https://github.com/meteor/react-packages/issues/382)
The answer there is "as a workaround, do not pass a second argument to useTracker()" - basically deps are broken in 2.5+ I'm sticking to 2.4.0 for now
It was published under the namespace react-meteor-data@2.6.2. If this issue is still not solved, please reopen it.
Hello all,
I encountered this issue after update to version 2.5.0 of the react-meteor-data package. It very easy to reproduce. I did so far the following in my code. I use the useTracker method to trigger a subscription as soon as any depth changes. In the mean time my depth contain limit and skip values. I realize a pagination with this. So i always renew the subscription and until version 2.4.0 it worked like a charm. Since version 2.5.0 I see in the chrome meteor plugin that the subscription is never cleaned up. I creates a new subscription with a new ID on each change of skip and limit, but never clean up the subscription. And before I always found my data with the skip value of 0. Always the part of the documents I want I found in the useTracker method when calling the find().fetch(). I enclose here my code example and as I said until version 2.40 it worked fine. according to the documentation of useTracker() its written that this will be cleaned up automatically as soon as any depth is changing or the component is unmounted. But I had no luck with the new version. I tried also version 2.6.1 (latest). Same thing happen here. Maybe someone can help me with this issue and give me a hint if there was a drastic change in the useTracker() method.
Thanks in advance for any help.
Daniel
Example Code:
` const useOrdersSubscription = () => useTracker(() => {
` const useOrders = () => useTracker(() => {