The lightweight and powerful UI rendering engine without dependencies and written in TypeScript💫 (Browser, Node.js, Android, iOS, Windows, Linux, macOS)
I am using a Page component that has an App child component.
On the server:
a DataClient is created and given to the App component
The App component is rendered
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.
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.
I am using a
Page
component that has anApp
child component. On the server:DataClient
is created and given to theApp
componentApp
component is renderedDataClient
is then given to thePage
component. This allows thePage
component to use the data needed to renderApp
, without duplicating logic and without performing the same requests twice.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.