Add a Doc.Hydrate
helper, similar to Doc.ClientSide
that also renders server-side content
#237
Labels
Doc.Hydrate
helper, similar to Doc.ClientSide
that also renders server-side content
#237
The
Doc.ClientSide <@ MyClientSideDoc() @>
function (aliasclient
) serves to insert an empty placeholder in server-side rendering, to be filled in with client-generated content automatically.However, for SEO and page load experience purposes, it's often nice to return some plain rendered content from the server, to be replaced with it's activated equivalent on the client.
New
Doc.Hydrate
helper would do this.Doc.Hydrate (MyClientOrServerSideDoc())
would auto-quote but also evaluate the argument, rendering it both on the server and then replacing it with the activated component on the client. You can useIsClient
checks within your logic to make sure no JavaScript-only calls happen during the server-side execution.The text was updated successfully, but these errors were encountered: