Preventing subscription.stop() on unmount when using useTracker()

Hi. I have a react hooks component that uses useTracker, similar to how I see it used in various how-tos

export const MyComponent = () => {
   const { items, loading } = useTracker(() => {
      const subscription = Meteor.subscribe('mySubscription');
      if (subscription.ready()) {
         return { items: Items.find().fetch(), loading: false };
      }
      return { items: [], loading: true };
   });
}

Now, I notice that when this component unmounts, the ‘unsubscription’ is automatic, although I don’t call subscription.stop() explicitly anywhere. This is great in most cases, but what if I don’t want it to automatically unsubscribe when the component unmounts? Is there a way to hang on to the subscription so that I can choose exactly when to call subscription.stop() (some time after the unmount) ?

You might want to search about “caching subscriptions” here in the forum

Add the tracker to a parent component and pass down the props. You can get as high as the top index.js. You can also write conditions for React.memo so that your app doesn’t update on updates of your subscription.
Keeping subscriptions on for unmounted components may lead to uncontrolled behavior.

Ah! I had to read this a couple times, but then I think it clicked. This makes perfect sense. This way I can still let the unsubscribe happen ‘automatically’, but that will be controlled by when the parent component unmounts. Think that’s what you mean, anyway.