Astro
astro/client-only-framework
Give client:only the framework of the component (client:only="react"), and a fallback slot for the space it fills.
moderatestaticfe-astro
Why
client:only skips server rendering, so Astro never runs the component at build time and cannot find out which framework renderer it needs. Without the value the island cannot be hydrated correctly, and with no fallback the space stays empty until the script runs, which shifts the layout.
Fix
Name the framework: client:only="react" (or preact, vue, svelte, solid-js). Put placeholder content with slot="fallback" inside the component so the page reserves the space. Prefer client:load, client:idle or client:visible when the component can render on the server.
Examples
<!-- bad -->
<Map client:only />
<!-- good -->
<Map client:only="react"><p slot="fallback">Loading the map…</p></Map>Sources
Facts
- Id
astro/client-only-framework- Severity
- moderate
- Check
- static checked in the source by
audit - Applies to
astro- Only in projects with
astro- Taught by the skill
fe-astroAstro sites and islands- Since version
- 0.1.0
Read it in the terminal
npx github:dawidolko/frontend-skills explain astro/client-only-framework