Compatible with apollo@3 hooks ?
Ziker22 opened this issue ยท 2 comments
Hello im trying to make prepass work with apollo 3(useQuery hook) together with nextjs
I took this from docs
ssrPrepass(<App />, (element, instance) => {
if (instance && instance.fetchData) {
return instance.fetchData()
}
})
My problem is since im using hooks instances of my components doesnt seem to have fetchData
property
Is there any chance i can check different condition ? Or should i switch to apollos Query
component ? Or theres no way to make this work ?
Any advice will be highly appreciated :)
@Ziker22 based on e04b17b and my own attempts to reconcile Apollo 3 + react-ssr-prepass, I believe that there's no longer a supported answer for this, regardless of whether you use the Hooks-based approach or Query components.
(But I'd also love to hear if anyone has somehow figured out a decent workaround that allows for react-ssr-prepass X Apollo 3 compatibility)
Well, Apollo doesn't support Suspense as far as I know, especially suspense during SSR is what react-ssr-prepass
would need it to work, so unfortunately all the old docs sections (that were removed) for react-apollo v2 don't apply anymore