Skip to content

Commit

Permalink
Merge pull request withastro#133 from leoj3n/patch-3
Browse files Browse the repository at this point in the history
Update component-hydration.md
  • Loading branch information
jonathantneal authored Feb 17, 2022
2 parents 4836351 + edbdeca commit fa31269
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/en/core-concepts/component-hydration.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ If more than one renderer is included in the Astro [config](/en/reference/config

[Astro components](/en/core-concepts/astro-components) (`.astro` files) are HTML-only templating components with no client-side runtime. If you try to hydrate an Astro component with a `client:` modifier, you will get an error.

To make your Astro component interactive, you will need to convert it to the frontend framework of your choice: React, Svelte, Vue, etc. If you have no preference, we recommend React or Preact as they are most similar to Astro’s syntax.
To make your Astro component interactive, you will need to convert it to the frontend framework of your choice: React, Svelte, Vue, etc. If you have no preference, we recommend React or Preact as they are most similar to Astro’s syntax. Using a frontend framework provides a client-side runtime that encapsulates the JavaScript and allows usage of `client:` modifiers per component instance.

Alternatively, you could add a `<script>` tag to your Astro component HTML template and send JavaScript to the browser that way. While this is fine for the simple stuff, we recommend a frontend framework for more complex interactive components.
Alternatively, you could add a `<script>` tag to your Astro component HTML template and send JavaScript to the browser that way, but this script will execute in the global scope and there will be no client-side component to attach a `client:` modifier to. While this is fine for the simple stuff, we recommend a frontend framework for more complex interactive components.

```astro
---
Expand Down

0 comments on commit fa31269

Please sign in to comment.