-
Notifications
You must be signed in to change notification settings - Fork 64
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
Hydratation bug with first render #90
Comments
I found a solution, the store did not get the the store at the first render, and has it is save in globalApolloClient, remaining empty. here the file that works with my modification :). https://gist.github.com/adrienpsl/b99a6d0ae10803ea433bed544ce38142 Have a nice day ! : |
@adrienpsl Your modification actually solved my hydration issue with some text content inconsistence issue between server and client side. I was able to do some semi dynamic persistent layout with next.js and apollo. |
Hi @aboveyunhai :), You right if we are 2 I reopen this issu. |
Here's the demo source code https://github.com/adamsoffer/next-apollo-example/tree/f4ea2ffd05e18af15589051ffcbd688d6b8019a1 (visible by visiting https://next-with-apollo.vercel.app/_src) |
@adamsoffer just a weird question to elaborate the demo.
and then still do |
Not sure. The page config might override it. |
@adamsoffer , that's the behavior I would expect, but it seems like it will cause some inconsistency on SSR (For example , SSR on page), it's hard to produce the issue. https://gist.github.com/adrienpsl/b99a6d0ae10803ea433bed544ce38142#file-next-apollo-tsx-L99 (only fewer lines inside if statement) added by @adrienpsl somehow solved it. Probably you can take a look, there might be a bug from the current package. I'm still not quite understanding everything behinds Apollo state on initialization. |
@aboveyunhai feel free to submit a PR if that fixes something not working. If persistent layout is what you're after check this out https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/ |
@adrienpsl just want to further enhance your implementation in case if you hadn't meet the problem.
It seems like the problem only occurs on the really first render and and then you switch pages from |
Hello,
I have followed the instructions in the readme but my page when it loads does the same query as the ssr page.
However there is the NEXT_DATA with the right data.
My cache is not hydrated, is it possible to have the source code of the demo so that I understand what I did wrong?
also:
In a page contained by WithApollo
I have as props:
The apolloState has the right data, how can I pass them to Apollo client ?
Thanks! :).
The text was updated successfully, but these errors were encountered: