I’ve just been reviewing react-meteor-data and had some questions that I haven’t had to ask before.
(because I used Vue, or I used TanStack Query, or I never touched the hooks API for Meteor before, etc)
Firstly, it looks like the suspense version of useSubscribe internally passes subscription parameters to useEffect’s dependency array, but the original non-suspense version doesn’t; is there some sort of performance or rendering implication there? Does it matter if a non-suspense useSubscribe is in a frequently re-rendered function?
Secondly, I got caught on this last line for the suspense version of useFetch:
This is a version of
useFindthat can be used with React Suspense […] third parameter is optional, and it is dependency array object. It’s meant for the SSR, you don’t have to use it if you’re not interested in SSR
that’s me, I’m interested in SSR!
I just was a bit confused what was meant here. I personally like the non-suspense API for useFetch more, does this mean though for SSR I must use the suspense function? Likewise, if using SSR, I must pass all (stateful/prop-drilled) dependencies used in the query in this array at the end?
Thanks for any insights from the resident Meteor+React peeps!