summaryrefslogtreecommitdiff
path: root/docs/guides/data-fetching.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/guides/data-fetching.md')
-rw-r--r--docs/guides/data-fetching.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/guides/data-fetching.md b/docs/guides/data-fetching.md
index 29a5bb160..44c25f90e 100644
--- a/docs/guides/data-fetching.md
+++ b/docs/guides/data-fetching.md
@@ -8,6 +8,7 @@ Astro support `fetch()` and "top-level await" to help you do remote data fetchin
**Important:** These are not yet available inside of non-page Astro components. Instead, do all of your data loading inside of your pages, and then pass them to your components as props.
## Example
+
```astro
// Example: src/pages/foo.astro
// top-level `fetch()` and `await` are both supported natively in Astro (pages only).
@@ -22,4 +23,4 @@ const allPokemon = allPokemonResult.results;
{allPokemon.map((pokemon) => (<h1>{pokemon.name}</h1>))}
</body>
</html>
-``` \ No newline at end of file
+```