Skip to content

Commit

Permalink
Update data-fetching.mdx (withastro#2854)
Browse files Browse the repository at this point in the history
Co-authored-by: Yan Thomas <[email protected]>
Co-authored-by: Chris Swithinbank <[email protected]>
  • Loading branch information
3 people authored Mar 15, 2023
1 parent 59cb59b commit e54dec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/data-fetching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ i18nReady: true

## `fetch()` in Astro

All [Astro components](/en/core-concepts/astro-components/) have access to the [global `fetch()` function](https://developer.mozilla.org/en-US/docs/Web/API/fetch) in their component script to make HTTP requests to APIs. This fetch call will be executed at build time, and the data will be available to the component template for generating dynamic HTML.
All [Astro components](/en/core-concepts/astro-components/) have access to the [global `fetch()` function](https://developer.mozilla.org/en-US/docs/Web/API/fetch) in their component script to make HTTP requests to APIs. This fetch call will be executed at build time, and the data will be available to the component template for generating dynamic HTML. If [SSR](/en/guides/server-side-rendering/) mode is enabled, any fetch calls will be executed at runtime.

💡 Take advantage of [**top-level await**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#top_level_await) inside of your Astro component script.

Expand Down

0 comments on commit e54dec5

Please sign in to comment.