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
The current renderToString implementation actually already handles async component (i.e. waiting on a component before it resolves) so it should be simple to use similar logic to wait on data fetching. We just need to have a convention or internal mechanism for a component to signal that it needs to wait for a preFetch function to finish before continuing the rendering.
This would allow for automatic data prefetching (for example with apollo) on the server.
Ideas:
waitCounter = 0
renderToString
withthis.waitForPrefetch()
(waitCounter++
)waitCounter
is0
, resolverenderToString
this.prefetchDone()
after fetching datathis.waitForPrefetch()
againwaitCounter--
waitCounter
is0
we resolverenderToString
this.waitForPrefetch()
(maybe make this parametrable, likemaxReRenders
)<NoSSR>
component prevents both server-side render and async prefetchingskipPrefetch () { return this.myProp }
option?The text was updated successfully, but these errors were encountered: