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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with rehydrate #157

Open
athakral opened this issue Mar 24, 2019 · 1 comment
Open

Issue with rehydrate #157

athakral opened this issue Mar 24, 2019 · 1 comment

Comments

@athakral
Copy link

Hi @leebenson ,

Thanks for ton, for this amazing boilerplate. For sure have saved me tons of hours. 馃憤

Wanted to discuss a challenge that I am facing. As per https://github.com/leebenson/reactql/blob/master/src/entry/client.tsx#L63

Rehydration of the state from the local storage occurs after the apolloClient is already created at line https://github.com/leebenson/reactql/blob/master/src/entry/client.tsx#L44.

Now, if I used my store to keep the logged the authentication token, the store autosaved to localstorage. But would not be hydrated at the time of Apollo client creation. That basically means that it, since the store is hydrated later.

Now, if I move line https://github.com/leebenson/reactql/blob/master/src/entry/client.tsx#L63
to https://github.com/leebenson/reactql/blob/master/src/entry/client.tsx#L42.

So, hydrate before creating the client. I get this error in client console.

react-dom.development.js:507 Warning: Expected server HTML to contain a matching <div> in <header>.

Please let me know if you have additional questions or if I can help any how to fix this

@athakral
Copy link
Author

I am using version 4.2.1

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

1 participant