Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to use getDataFromTree also on client? #146

Open
borekb opened this issue Jul 28, 2020 · 3 comments
Open

Option to use getDataFromTree also on client? #146

borekb opened this issue Jul 28, 2020 · 3 comments

Comments

@borekb
Copy link

borekb commented Jul 28, 2020

Currently, getDataFromTree works only during SSR due to this condition:

if (typeof window === 'undefined') {

On the client, you'll see "Loading..." due to this, which is not bad but an alternative UX that we actually prefer is to wait for all data to load and only then change the route, sort of like with turbolinks.

To achieve that, we maintain a fork of with-apollo but that is own drawbacks, obviously. Would this project consider accepting a PR that would make this configurable, like this?

export default withApollo(Index, { getDataFromTree, useGetDataFromTreeAlsoOnClient: true });

(Naming it will be challenging 😄.)

@Faisal-Manzer
Copy link

Hey, can I get access to the fork repo. This issue is just annnoying.

@zenflow
Copy link

zenflow commented Mar 30, 2021

Before this can work this Next.js issue will need to be fixed: vercel/next.js#10126 / vercel/next.js#9336

Maybe clientPrepass: true? It should be something short anyways 😄

@zenflow
Copy link

zenflow commented Apr 1, 2021

clientSidePreload: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants