dark icon indicating copy to clipboard operation
dark copied to clipboard

[data] Make dehydration of DataClient manual

Open einar-hjortdal opened this issue 6 months ago • 1 comments

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 avatar Aug 09 '24 14:08 einar-hjortdal