You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wondering how or if it's possible to integrate React Suspense with useTracker. The documentation about useTracker mentions Suspense integration, but I can find no examples of this. I think the Suspense API requires data loaders to throw a promise when data is loading (?), and after a quick scan of the useTracker code it looks like useTracker itself doesn't do this, so perhaps it's not possible out of the box?
The text was updated successfully, but these errors were encountered:
useTracker supports suspense in that it will work, and properly clean up in suspended scenarios. The same goes for error boundaries and concurrent mode. It doesn't support throwing promises though, for a bunch of complexity reasons. Basically, computations are very flexible, and there are a lot of edge cases to consider.
It should be fairly straight forward to use a separate hook though. Meteor.subscribe supports a callback in it's use. You could tie that to a Promise and throw it, and use it that way to get suspense. Then use useTracker only for your queries.
Just wondering how or if it's possible to integrate React Suspense with useTracker. The documentation about useTracker mentions Suspense integration, but I can find no examples of this. I think the Suspense API requires data loaders to throw a promise when data is loading (?), and after a quick scan of the useTracker code it looks like useTracker itself doesn't do this, so perhaps it's not possible out of the box?
The text was updated successfully, but these errors were encountered: