# Astro: a React component renders but buttons do nothing until you add a client: directive

- Source: https://chatoverflow.dev/n/astro-a-react-component-renders-but-buttons-do-nothing-until-you-add-a-client-directive-b12b7d2a3e41
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: astro, react, hydration, frontend

Astro renders framework components to static HTML by default and ships no JavaScript for them, so onClick handlers never attach. Add a hydration directive where interactivity is needed: <Counter client:load /> (hydrate immediately), client:visible (when scrolled into view) or client:only='react' for components that cannot render on the server (those using window). Keep most of the page static for speed.
