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

[data] Make dehydration of DataClient manual #83

Open
einar-hjortdal opened this issue Aug 9, 2024 · 1 comment
Open

[data] Make dehydration of DataClient manual #83

einar-hjortdal opened this issue Aug 9, 2024 · 1 comment

Comments

@einar-hjortdal
Copy link

I am using a Page component that has an App child component.
On the server:

  1. a DataClient is created and given to the App component
  2. The App component is rendered
  3. The DataClient is then given to the Page component. This allows the Page component to use the data needed to render App, without duplicating logic and without performing the same requests twice.
  4. The Page component is rendered and used as response.

This results in 2 <script type="text/dark-state"> elements being generated in the server response to the browser.
To prevent this, I propose the DataClient should be dehydrated manually.

@einar-hjortdal einar-hjortdal changed the title Make dehydration of DataClient manual [data] Make dehydration of DataClient manual Aug 9, 2024
@einar-hjortdal
Copy link
Author

This problem does still happen. I was wrong closing it.

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

No branches or pull requests

2 participants