#Astro renders html of framework components

1 messages · Page 1 of 1 (latest)

west talonBOT
#

Hi @quaint loom. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes.

  1. By default (no client:*):
    A Solid component used in an Astro file is rendered to static HTML on the server. [Front-end frameworks]

  2. With most client:* directives (client:load, client:idle, client:visible, client:media):
    The component is still rendered to HTML on the server first, and then that HTML is hydrated in the browser according to the chosen directive. [Hydrating interactive components]

  3. Exception – client:only:
    client:only skips server-side HTML rendering and renders only on the client. [client:only]

For Solid specifically, server-rendered components (including hydrating ones) are rendered with Solid’s renderToStringAsync, so their HTML is included in the initial server-rendered page; client:only Solid components are excluded from this and only render on the client. [Solid usage; client:only]

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: